Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working with paths (?) #2

Closed
nicoddemus opened this issue Nov 24, 2015 · 6 comments
Closed

Not working with paths (?) #2

nicoddemus opened this issue Nov 24, 2015 · 6 comments

Comments

@nicoddemus
Copy link
Owner

Follow up of pytest-dev/pytest#1187.

$ rm -rf /tmp/pytest-* ; python3 -m py.test --collect-only --traceconfig tests/unit/ tests/ | grep -P 'collected|-dup-'
  pytest-drop-dup-tests-0.1.0 at /home/xxx/.local/lib/python3.4/site-packages/pytest_drop_dup_tests.py
    drop-dup-tests      : /home/xxx/.local/lib/python3.4/site-packages/pytest_drop_dup_tests.py
plugins: drop-dup-tests-0.1.0
collected 418 items

CC @htgoebel

@nicoddemus
Copy link
Owner Author

@htgoebel I created this directory structure, with each file containing a single test:

tests/
- unit/
-- test_foo3.py
- test_foo2.py
test_foo1.py

And I get the expected behavior:

py.test tests\unit\ tests\ .
============================= test session starts =============================
platform win32 -- Python 3.5.0, pytest-2.8.3, py-1.4.30, pluggy-0.3.1
rootdir: X:\pytest-drop-dup-tests, inifile:
plugins: drop-dup-tests-0.1.0
collected 6 items

tests\unit\test_foo3.py .
tests\test_foo2.py .
test_foo1.py .

=================== 3 passed, 3 deselected in 0.03 seconds ====================

Could you please post the full output of your command?

@nicoddemus
Copy link
Owner Author

Oh I just realized, please note that the number of tests collected is 6, but the plugin will deselect the duplicated tests.

@nicoddemus
Copy link
Owner Author

Just pushed a change which will prevent pytest from collecting paths twice. Could you please try again?

@htgoebel
Copy link

htgoebel commented Dec 6, 2015

Sorry for coming back on this late. I'v been busy with my day-job.

Thanks for the update, I now get the correct messages:

$ rm -rf /tmp/pytest-* ; /tmp/foo/bin/python -m py.test --collect-only --traceconfig test/unit tests/ | grep -P 'collected|-dup-'
pytest-drop-dup-tests-0.1.0 at /tmp/foo/lib/python2.7/site-packages/pytest_drop_dup_tests.pyc
    drop-dup-tests      : /tmp/foo/lib/python2.7/site-packages/pytest_drop_dup_tests.pyc
plugins: drop-dup-tests-0.1.0
collected 348 items

Please drop me a note when this plugin is available at PyPI.

Thanks for implementing this and thanks for the quick response :-)

@nicoddemus
Copy link
Owner Author

It´s already on pypi: https://pypi.python.org/pypi/pytest-drop-dup-tests 😄

@htgoebel
Copy link

htgoebel commented Dec 6, 2015

Oh, great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants