Skip to content

Conversation

@bobleesj
Copy link
Contributor

@bobleesj bobleesj commented Dec 7, 2024

Closes #205 - match tests and src folder structures.

@github-actions
Copy link

github-actions bot commented Dec 7, 2024

Warning! No news item is found for this PR. If this is a user-facing change/feature/fix,
please add a news item by copying the format from news/TEMPLATE.rst.

@bobleesj
Copy link
Contributor Author

bobleesj commented Dec 7, 2024

@sbillinge ready for review, just quick cosmetics fix.

@codecov
Copy link

codecov bot commented Dec 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.49%. Comparing base (d8d7fb3) to head (06576d6).
Report is 11 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #206   +/-   ##
=======================================
  Coverage   96.49%   96.49%           
=======================================
  Files           8        8           
  Lines         342      342           
=======================================
  Hits          330      330           
  Misses         12       12           
Files with missing lines Coverage Δ
tests/parsers/test_loaddata.py 100.00% <ø> (ø)
tests/parsers/test_serialization.py 100.00% <ø> (ø)

@sbillinge
Copy link
Contributor

What is the reason for doing this?

@bobleesj
Copy link
Contributor Author

bobleesj commented Dec 9, 2024

What is the reason for doing this?

Since test files are all located under tests, I am trying to mirror the structure of the src directory with the tests directory.

src/
└── parser/
    └── loaddata.py

tests/
└── parser/
    └── test_loaddata.py

@sbillinge
Copy link
Contributor

What is the reason for doing this?

Since test files are all located under tests, I am trying to mirror the structure of the src directory with the tests directory.

src/
└── parser/
    └── loaddata.py

tests/
└── parser/
    └── test_loaddata.py

Yes, I understand what you are trying to do. I am wondering why. I would think just having the tests flat is easier to manage and maintain. They don't have to replicate any package structure.

@sbillinge
Copy link
Contributor

if we worry about name clashes (there shouldn't be too many) it should be easy to disambiguate. If we thought it helped we could use the full package name in the file name if we liked too, like test_parser.loaddata.py but even this coud be a bit of overkill. But I could be persuaded otherwise.

@bobleesj
Copy link
Contributor Author

bobleesj commented Dec 9, 2024

understand what you are trying to do. I am wondering why. I would think just having the tests flat is easier to manage and maintain. They don't have to replicate any package structure.

I had thought it was standard to mirror the src structure, but now, after thinking and searching more, I don't have a clear reason. Also, adopting a flat structure doesn’t deviate from the fact that tests aren't written for the code but rather for flexibility, and we write tests for intended behavior, not for the code itself.

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.

Match tests folder structure to src folder structure

2 participants