diff options
author | Christoph Reiter <reiter.christoph@gmail.com> | 2018-02-11 18:08:07 +0100 |
---|---|---|
committer | Christoph Reiter <reiter.christoph@gmail.com> | 2018-02-12 00:25:28 +0100 |
commit | 5a25c98cb6d387791e41c7dc240c55814988519a (patch) | |
tree | 9b92cbf881cc8458a0532ce686fe6c8f8e7c4970 /setup.py | |
parent | 21cee6cc4fbc7fb1a28a15840924b0da52b49fca (diff) | |
download | pygobject-wip/creiter/pytest-direct.tar.gz |
tests: Make it possible to use pytest directlywip/creiter/pytest-direct
pytest will just import the files passed to it and try to run tests.
Since we need to run some setup code convert the tests directory to
a Python package and do the initialization in __init__.py. This makes
the init code (env vars, typelib search path, dbus) always run when
something from the package gets imported.
python3 setup.py build_tests # build pygobject and tests
py.test-3 tests/test_gi.py # run tests in test_gi.py only
Diffstat (limited to 'setup.py')
-rwxr-xr-x | setup.py | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -237,6 +237,11 @@ class build_tests(Command): return True def run(self): + cmd = self.reinitialize_command("build_ext") + cmd.inplace = True + cmd.ensure_finalized() + cmd.run() + from distutils.ccompiler import new_compiler from distutils.sysconfig import customize_compiler @@ -440,11 +445,6 @@ class test(Command): pass def run(self): - cmd = self.reinitialize_command("build_ext") - cmd.inplace = True - cmd.ensure_finalized() - cmd.run() - cmd = self.reinitialize_command("build_tests") cmd.ensure_finalized() cmd.run() |