Skip to content

TST: add test_eopc04_1962-now.py#53

Open
neutrinoceros wants to merge 1 commit intoastropy:mainfrom
neutrinoceros:tst/proper-testing
Open

TST: add test_eopc04_1962-now.py#53
neutrinoceros wants to merge 1 commit intoastropy:mainfrom
neutrinoceros:tst/proper-testing

Conversation

@neutrinoceros
Copy link
Copy Markdown
Contributor

Not done yet, but opening early as a warm up round.
This is the first piece towards #21

@pllim
Copy link
Copy Markdown
Member

pllim commented Mar 16, 2026

Why remove the init? If you don't want the init, might as well move the test folder to root dir?

Comment thread astropy_iers_data/tests/test_epoc04_1962-now.py Outdated
@neutrinoceros
Copy link
Copy Markdown
Contributor Author

Why remove the init?

it serves no purpose, besides maybe forcing git to track an otherwise empty dir.

If you don't want the init, might as well move the test folder to root dir?

sure thing

@neutrinoceros neutrinoceros force-pushed the tst/proper-testing branch 6 times, most recently from c4d3ab9 to 26f370e Compare March 17, 2026 10:33
@neutrinoceros neutrinoceros force-pushed the tst/proper-testing branch 4 times, most recently from 84611c1 to 4289cde Compare March 17, 2026 10:46
@neutrinoceros
Copy link
Copy Markdown
Contributor Author

neutrinoceros commented Mar 17, 2026

this is now ready for review.
Tests themselves should be straightforward to read, and I tried to keep the parsing logic that supports them intentionally brittle and 100%1 covered. I made sure the only dependency, besides the stdlib, is pytest, and focused my testing on two crucial areas: the header, and the last 256 lines (which should generously cover all added lines in auto updates).
There's also some logic to check for value ranges by specifying optional (lower, higher) bounds for each columns. These are minimally exercised for the first column at the moment, and can easily be added later (or during reviews) if needed.

Footnotes

  1. some branches are intentionally unreachable and marked as such. If they're reached, it'll signal broken test logic.

@neutrinoceros neutrinoceros marked this pull request as ready for review March 17, 2026 10:47
@neutrinoceros neutrinoceros force-pushed the tst/proper-testing branch 3 times, most recently from b65876f to 7b63532 Compare March 17, 2026 10:50
@neutrinoceros neutrinoceros force-pushed the tst/proper-testing branch 5 times, most recently from 581e4f1 to 547d396 Compare March 17, 2026 14:21
@neutrinoceros
Copy link
Copy Markdown
Contributor Author

actually checking all data elements didn't turn out to be prohibitively slow as I first expected, so the check is now much more extensive

@neutrinoceros neutrinoceros changed the title TST: add test_epoc04_1962-now.py TST: add test_eopc04_1962-now.py Mar 17, 2026
@neutrinoceros neutrinoceros force-pushed the tst/proper-testing branch 2 times, most recently from e1ea5cb to a14e9ca Compare March 17, 2026 16:00
@neutrinoceros
Copy link
Copy Markdown
Contributor Author

@astrofrog for reference, I plan to wait until my approach here is validated (or not) before I add more tests. Ideally I would like to have tests for every data file receiving auto updates, but the cost of building them should get much lower if I can reuse at least some of what I'm proposing for this first PR.

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.

3 participants