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

Add client to import #20

Closed
wants to merge 1 commit into from
Closed

Add client to import #20

wants to merge 1 commit into from

Conversation

katkaypettitt
Copy link
Contributor

The following error appears without importing client:

E       fixture 'client' not found
>       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
>       use 'pytest --fixtures [testpath]' for help on them.

This is remedied by importing client as suggested.

The following error appears without importing `client`:

```
E       fixture 'client' not found
>       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
>       use 'pytest --fixtures [testpath]' for help on them.
```

This is remedied by importing `client` as suggested.
@katkaypettitt katkaypettitt deleted the patch-1 branch May 12, 2021 07:43
@katkaypettitt
Copy link
Contributor Author

This was also the case for sitemap_tests.py. However, it is highly possible the problem was on my end—hence why the PR has been closed.

@mikeckennedy
Copy link
Member

Thanks. I do think the tests ran when I put them together during the recording.

@katkaypettitt
Copy link
Contributor Author

katkaypettitt commented May 12, 2021

Thanks for the response, Mike! While I have you, the import statements were collapsed for the sitemap_test video but client was imported in package_tests (there was even a comment about importing it). Was it taken out for some reason?
^ see video "Integrated Tests" around 2:30

@mikeckennedy
Copy link
Member

The problem was this seems to only work if you run tests for the whole project (which loads client) but doesn't work if you run it directly. I just committed a more general fix:

5280da5

@katkaypettitt
Copy link
Contributor Author

Such an elegant fix! Thanks for this.

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

Successfully merging this pull request may close these issues.

2 participants