test: restructure suite — shared conftest, markers, drop dead tests, error.py coverage#107
Merged
Merged
Conversation
- add tests/conftest.py: datamaxi/telegram/naver fixtures, API_KEY/BASE_URL, _FLAKY_PROD_DATA_XFAIL; remove copy-paste from test_call/test_integration - register integration/smoke markers; --strict-markers; drop unused errors - mark live lanes (integration/smoke) so keyless CI deselects via -m - drop no-op TestErrorHandling + duplicate test_candle_with_from_unix
prod /api/v1/premium expects full token name, not ticker; 'BTC' returned no data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Restructures the test suite per #106. Most of the original issue was already
addressed by prior PRs (#101 added granular
responses-mocked keyless testscovering validation + liquidation/open-interest/error; #96/#103/#105 set up the
keyless CI lane). This PR closes the remaining gaps:
tests/conftest.py— moves thedatamaxi/telegram/naverfixtures,
API_KEY/BASE_URLresolution, and_FLAKY_PROD_DATA_XFAILmarker(previously copy-pasted verbatim) into one place.
tests/__init__.pyadded sofrom tests.conftest import ...resolves to pytest's single conftest instance.integration+smoke, drop now-unusederrors,enable
--strict-markers. Live lanes are marked so the keyless CI lanedeselects them by marker.
pytest tests/ -m "not integration"(was
-k "not integration"). Runs keyless, no network, across the existingpy3.10–3.14 matrix.
test_invalid_exchange/test_invalid_symbol(
except (ValueError, Exception): pass, asserts nothing) and the duplicatetest_candle_with_from_unix(identical args totest_candle_with_from_and_to_unix).tests/test_error.py— direct unit coverage forerror.py(ClientError/ServerError field storage, ParameterRequired / AtLeastOneParameter
message formatting), which was only exercised indirectly before.
Note:
tests/util.py::mock_http_responseis NOT removed — the issue called itdead, but #101 now uses it across ~12 test modules.
Test plan
env -u DATAMAXI_API_KEY python -m pytest tests/ -m "not integration" -q→ 113 passed, 11 skipped, 116 deselected.
python -m pytest --collect-only -q→ 240 collected, no import errors.black --check .andflake8 . --statisticsboth clean.Closes #106