Reorganize tests into domain-grouped subdirectories#24
Reorganize tests into domain-grouped subdirectories#24plind-junior wants to merge 4 commits intoentrius:testfrom
Conversation
|
Hey @LandynDev @anderdc , could you take a look at this when you get a chance? No functional changes — purely test infrastructure. The main things to verify are that the subdirectory layout makes sense to you and that the helpers.py factory pattern is the right abstraction for shared fixtures. Happy to adjust the structure if you prefer something different. |
02607e3 to
11a38cc
Compare
|
Hi @LandynDev, when you have a moment, could you please review my PR? No rush — just wanted to bring it to your attention. Thanks! |
807496e to
d8cdf76
Compare
Adds new test files covering axon handlers, chain provider base and factory, config, logging, misc utilities, metadata, subtensor provider, and swap poller. Also extends test_bitcoin_signing.py with cases for to_mainnet_wif, to_mainnet_address, and BitcoinProvider init paths.
LandynDev
left a comment
There was a problem hiding this comment.
Hey, gave this a pass
-
drop dupes in
test_subtensor.py—TestDecodeCompactandTestIsValidAddressalready exist in test_scale.py (landed in #52). delete this please -
fix mislabeled tests in
TestRejectSynapse—
test_no_context_no_log_errorandtest_with_context_logs_debugdon't assert
on logging. either rename to match, or patchbt.logging.debugand assert
the call.
Also, please take another pass with an eye toward trimming. A chunk of these
assertions are exercising stdlib or third-party behavior rather than our code
(keccak determinism, functools.wraps metadata, logging.addLevelName,
argparse defaults, METADATA_DIR.is_dir(), mock-call-counted pass-throughs).
If a test would still pass after deleting our implementation, it's probably
not earning its keep, please cut where that applies.
Just ping when those are in and i'll re-review.
…ak assertions - test_subtensor.py: remove TestDecodeCompact and TestIsValidAddress (already in test_scale.py from entrius#52); keep only TestProviderBasics - test_axon_handlers.py: TestRejectSynapse — patch bt.logging.debug and assert (no_context → not called; with_context → called once with '{context}: {reason}'); drop the three keccak property tests that exercise pycryptodome rather than our wrapper - test_misc.py: drop test_preserves_function_metadata (functools.wraps) and test_returns_current_block_from_subtensor (mock pass-through) - test_logging.py: drop test_returns_logger_at_events_level, test_registers_event_level_name, test_adds_handler — all just verify stdlib logging plumbing we passed through - test_config.py: drop pure-default argparse tests; keep override tests which actually exercise our flag-name + type wiring - test_metadata.py: deleted (only checks pathlib behavior on a Path(__file__).parent constant) 363 tests pass.
# Conflicts: # tests/test_axon_handlers.py
Summary
tests/layout into subdirectories mirroring the source tree (core/,contract/,chain_providers/,validator/,miner/)test_scale.pyintocontract/test_scale.pyandchain_providers/test_subtensor.pyby concernmake_swap/make_confirmed_txfactories intotests/helpers.py, eliminating duplication across modulespytest-covwithterm-missingand HTML report targets; coverage baseline is 43%Test plan
uv run pytest— all 280 tests pass