Coder Social home page Coder Social logo

phabricator-pytest's Introduction

phabricator-pytest

Attempting Phabricator test in Python.

Install

git clone https://github.com/pdehaan/phabricator-pytest.git
cd phabricator-pytest
pipenv install -d

Running tests

./run.sh

Formatting and linting tests

If you installed the dev dependencies above (using the -d flag), running the $ ./lint.sh script will run both autopep8 and pylint:

./lint.sh

phabricator-pytest's People

Contributors

dependabot[bot] avatar pdehaan avatar

Watchers

 avatar  avatar  avatar

phabricator-pytest's Issues

Figure out how to relative import mozphab?

https://github.com/mozilla-conduit/review/blob/15d71924ede367e31a2ad6be64b06d6114e45967/tests/test_patch.py#L8-L10

This feels like an abyss.
https://docs.python.org/3/library/imp.html says that the imp class has been deprecated since python 3.4, and we should use importlib instead. But I can't find the correct python incantation to migrate that code.

Even using the deprecated code with a hardcoded local path to my moz-phab script, it looks like I see some vague error:

mozphab_test.py:1: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
...
ModuleNotFoundError: No module named 'ConfigParser'

import imp
import os

mozphab = imp.load_source(
    # "mozphab", os.path.join(os.path.dirname(__file__), os.path.pardir, "moz-phab")
    "mozphab", "/Users/pdehaan/dev/github/mozilla/phabricator/git-cinnabar/moz-phab"
)

print(mozphab)

"""
mozphab_test.py:1: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import imp
Traceback (most recent call last):
  File "mozphab_test.py", line 6, in <module>
    "mozphab", "/Users/pdehaan/dev/github/mozilla/phabricator/git-cinnabar/moz-phab"
  File "/Users/pdehaan/.local/share/virtualenvs/phabricator-pytest-dm0QBrpi/lib/python3.7/imp.py", line 171, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 696, in _load
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/pdehaan/dev/github/mozilla/phabricator/git-cinnabar/moz-phab", line 19, in <module>
    import ConfigParser
ModuleNotFoundError: No module named 'ConfigParser'
"""

I see this, which implies that ConfigParser (py 2.x) was renamed to configparser (py 3.x) lowercase, which may be a separate issue.

Note: The ConfigParser module has been renamed to configparser in Python 3. The 2to3 tool will automatically adapt imports when converting your sources to Python 3.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.