Fix pytest fixture registration bug. #4497

Merged
merged 3 commits into from Apr 21, 2017

Conversation

Projects
None yet
2 participants
@benjyw
Contributor

benjyw commented Apr 20, 2017

This required changing how we hook into pytest to modify
how it displays paths. The new hook is slightly more subtle,
but has the advantage of not having to be present during
test collection, which means we can put it in a tmpdir and
not in the source root, which allows us to get rid of a bunch
of complicated code dealing with an existing conftest.py
in the source root.

Fix pytest fixture registration bug.
This required changing how we hook into pytest to modify
how it displays paths.  The new hook is slightly more subtle,
but has the advantage of not having to be present during
test collection, which means we can put it in a tmpdir and
not in the source root, which allows us to get rid of a bunch
of complicated code dealing with an existing conftest.py
in the source root.
@kwlzn

kwlzn approved these changes Apr 21, 2017

lgtm

+import pytest
+
+
+V={}

This comment has been minimized.

@kwlzn

kwlzn Apr 21, 2017

Member

V = {}?

@kwlzn

kwlzn Apr 21, 2017

Member

V = {}?

+python_tests(
+ name='conf_test',
+ sources=globs('*.py')
+)

This comment has been minimized.

@kwlzn

kwlzn Apr 21, 2017

Member

2 space indent?

@kwlzn

kwlzn Apr 21, 2017

Member

2 space indent?

@benjyw benjyw merged commit 68b64f0 into pantsbuild:master Apr 21, 2017

1 check was pending

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details

@benjyw benjyw deleted the benjyw:fix_conftest branch Apr 21, 2017

lenucksi added a commit to lenucksi/pants that referenced this pull request Apr 25, 2017

Fix pytest fixture registration bug. (#4497)
This required changing how we hook into pytest to modify
how it displays paths.  The new hook is slightly more subtle,
but has the advantage of not having to be present during
test collection, which means we can put it in a tmpdir and
not in the source root, which allows us to get rid of a bunch
of complicated code dealing with an existing conftest.py
in the source root.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment