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

Rediscover new tests #44

Closed
sysradium opened this issue Feb 9, 2016 · 5 comments · Fixed by michaeljoseph/mould#12
Closed

Rediscover new tests #44

sysradium opened this issue Feb 9, 2016 · 5 comments · Fixed by michaeljoseph/mould#12
Labels

Comments

@sysradium
Copy link

If I add a test file when PTW is already running the test is ignored by PTW unless I restart it.

It seems that you listen on changes for a list of files you gathered on PTW start and do not look for the new ones. Haven't checked the code yet but I think it's so. Maybe we should discover new tests as they appear.

@joeyespo
Copy link
Owner

This should be working right now. If not, I'll be releasing a new version soon that'll be much more robust with re-running.

Some questions for you.

  1. Where is your test directory in relation to your project? If ptw is run top-level, it should detect code changes and file additions/deletions in both your project and in your tests
  2. What OS are you using?

Thanks!

@sysradium
Copy link
Author

It depends.

project_root/
        code.py
        tests/
             test_one.py

Then I run ptw from a project root.
Another setup when each module-folder has a tests.py file. But in this case I also run ptw from project's root.

In both cases that was Linux.

@joeyespo
Copy link
Owner

joeyespo commented Apr 2, 2016

Ok, that all looks fine.

Just to be clear, if you save an existing test file, does ptw re-run?

@joeyespo joeyespo added the bug label Apr 2, 2016
@sysradium
Copy link
Author

As far as I remember - yes it does.

@joeyespo
Copy link
Owner

joeyespo commented Apr 6, 2016

Just published v4.0, which includes a possible fix (2107da5).

Try a pip install --upgrade pytest-watch and feel free to re-open if the problem persists. Thanks for the issue, @sysradium!

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

Successfully merging a pull request may close this issue.

2 participants