Skip to content

Unify temporary directory allocation strategy in tests#26

Open
KmoM88 wants to merge 1 commit into
colcon:masterfrom
KmoM88:KmoM88/tmp-path
Open

Unify temporary directory allocation strategy in tests#26
KmoM88 wants to merge 1 commit into
colcon:masterfrom
KmoM88:KmoM88/tmp-path

Conversation

@KmoM88

@KmoM88 KmoM88 commented Jun 11, 2026

Copy link
Copy Markdown

Following the upstream unification in colcon/colcon-core#729, this PR refactors the test suite to use the modern tmp_path fixture (which provides a pathlib.Path object) instead of mixing multiple temporary directory strategies.

Specifically, this package previously used:

  • The Pytest tmpdir fixture (in test/test_environment_library_path.py)

This refactor:

  1. Adds a test/conftest.py compatibility fixture for tmp_path (supporting older pytest versions, such as those on Enterprise Linux 8).
  2. Updates test/test_environment_library_path.py to use tmp_path instead of tmpdir.
  3. Cleans up an unused Path import and removes a redundant global spell_check_words_path declaration in test/test_spell_check.py to resolve pre-existing linter errors on modern environments.
  4. Updates test/spell_check.words to include words introduced by the compatibility fixture (isdigit, itertools, linux, takewhile, tmpdir).

Reference

Specifics

Unlike other submodules which used manual TemporaryDirectory blocks, colcon-library-path only used the tmpdir fixture.

🤖 Assisted by Gemini

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.

1 participant