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

few test improvements #30

Merged
merged 3 commits into from
May 8, 2024
Merged

few test improvements #30

merged 3 commits into from
May 8, 2024

Conversation

ikalnytskyi
Copy link
Owner

(see commits)

Do not run each test for each supported auth-type. Currently master runs
each test for 'store', 'credential-store' and 'creds' auth types.

There's no need to run each test with each auth type alias. This patch
changes this by always running tests with 'store' auth type, and
introducing a separate tests to verify that aliases works.
Even though type annotations are nasty, they do bring one significant
benefit - the code completion in text editors becomes much better. This
patch adds type annotations to python modules in the 'tests' directory.
The conftest.py today contains a hack that creates a session scoped
temporary directory, and set the HTTPIE_CONFIG_DIR environment variable
to that temporary directory. That previously has been done to make sure
I can run tests with configuration store elsewhere. Unfortunately, this
is a bit inconvenient because (1) we have to make sure there's no
imports to httpie package in global scope because otherwise the patch we
have won't work, (2) the creation and cleaning phase is scatted across
the code base.

This patch removes this hack in favor of (1) explicitly passing the
temporary directory to executing httpie environment context, and (2)
patching required attribute so the plugin can use the up to date version
whenever it runs.
@ikalnytskyi ikalnytskyi merged commit fd35ef6 into master May 8, 2024
8 checks passed
@ikalnytskyi ikalnytskyi deleted the chore/test-improvements branch May 8, 2024 19:05
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