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

New path API #10

Merged
merged 10 commits into from Aug 7, 2017
Merged

New path API #10

merged 10 commits into from Aug 7, 2017

Conversation

nicoddemus
Copy link
Collaborator

WIP towards changing the API to pathlib as discussed in #7

Still needs docs and probably merge the other PRs before moving this forward.

pytest-datadir does not embed tests into the package
assert os.path.isdir(self.module_dir) or os.path.isdir(self.global_dir),\
'neither {} or {} are valid data directories'.format(self.global_dir, self.module_dir)
@pytest.fixture
def global_datadir(request):
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure about the name of this fixture.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also it is not really "global" because it only looks for a "data" folder on the same directory as the test file requesting it.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree there is absolutely nothing "global" about that thing. Do we need it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was added in #1... I never used this functionality but it seems useful. What do you think? Maybe @mauriciosl can comment on it as well?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the motivation behind it. Basically if you have many test_*.py files using the same test resource file, without the "global" data dir you would be forced to copy the same file across many test data directories, which obviously is not a good practice. I vote to keep it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh sorry, I meant about the name of the fixture.

Copy link
Collaborator

@igortg igortg Aug 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yo guys, let's get back to work here. If you guys would like to have me as maintainer ;) I can finish the PR so we could release the 1.0.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. About shared_data, I think we can call it shared_datadir and call it a day for 1.0. What do you guys think?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@igortg you're more than welcome to contribute! I also agree with @nicoddemus to just wrap up the shared_datadir fixture and release as 1.0.

Change suggested by @nicoddemus: it's not really "global" because it
only looks for a "data" folder on the same directory as the test file
requesting it (PR gabrielcnr#10)
@nicoddemus
Copy link
Collaborator Author

Thanks @igortg! This needs to be rebased on master because of the conflicts.

# Conflicts:
#	README.md
#	pytest_datadir/__init__.py
#	pytest_datadir/plugin.py
#	tests/test_hello.py
Older versions of setuptools seems not work with environment marker
(i.e.: "python_version<"3.4")
@igortg igortg changed the title New path api (WIP, don't merge) New path API Aug 6, 2017
@igortg
Copy link
Collaborator

igortg commented Aug 6, 2017

Guys, all set. Waiting for review.

@nicoddemus
Copy link
Collaborator Author

LGTM, thanks @igortg! 👍

Let's wait for @gabrielcnr say on this.

@gabrielcnr gabrielcnr merged commit 14f2cdc into gabrielcnr:master Aug 7, 2017
@nicoddemus nicoddemus deleted the new-path-api branch August 7, 2017 11:02
@nicoddemus
Copy link
Collaborator Author

Thanks @gabrielcnr. If it is alright with you, I will add igor's user to PyPI so he can make the release.

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.

None yet

4 participants