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 config tests #37

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Conversation

bendtherules
Copy link
Contributor

Things done :
(In tests/ base directory)

  1. Add test_cases folder which contains some cases to mimic project structures ptw might face
  2. Test_ini_path_collected.test_basic - Test pytest.ini location reported by plugin is correct, in the most basic situation
  3. Test_ini_path_collected.test_from_inner_dir - Test pytest.ini location, when pwd is one level deeper than config file dir.
  4. Test_ini_path_collected.test_first_ini_from_inner_dir - Checked from inner directory, and there are two ini files in two subsequent upper level dir. Check that ini from the just upper level dir is found.
  5. Test_merge_config.test_works_alone - In merge_config func, check ini config only w/o cmdline args works.
  6. Test_merge_config.test_works_with_cmdline - Check ini config with cmdline args works.
  7. Test_merge_config.test_works_with_cmdline_precedence - Check ini config with cmdline args works, with cmdline precedence
  8. Test_merge_config.test_works_wo_ini - Check cmdline args works, w/o config file present.
  9. Test_merge_config.test_works_wo_pytest_watch_section - Check cmdline args + (pytest.ini without [pytest-watch] section) works.
  10. Test_merge_config.test_works_directories_ini_option - Check ini config with directories option works, related to Allow setting <directories> argument from pytest.ini #41 . It is marked for xfail, but should pass later once it is resolved.

I have put on a experimental xfail condition for test_works_directories_ini_option test, which checks if the #41 is actually still open and if yes, then xfail. Although this probably should be removed finally, it seems useful to me as a reminder in the interim period as long as the bug is not fixed.

Helpers:

  1. patched_chdir - Just like chdir, but can be used in with, sets back the old path at exit. Useful for moving around and copying files around.
  2. create_temp_case - Copy a test_case folder to a tmpdir and return the location of the copied folder.
  3. is_github_issue_open - Returns if a gh issue is open, useful for xfail condition.

@bendtherules
Copy link
Contributor Author

Ready for merge.

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

1 participant