coala / coala-bears

Bears for coala
https://coala.io/
GNU Affero General Public License v3.0
295 stars 580 forks source link

Use reusable method of locating test data #1602

Open jayvdb opened 7 years ago

jayvdb commented 7 years ago

The following bears, and maybe others, all have test data, and have a function to 'find' the test data relative to __file__

jayvdb commented 7 years ago

If there isnt an existing re-usable approach, a new one should be added in a standard base class coala/coala#3676

Makman2 commented 7 years ago

Yes definitely in for standardizing test folders. It's actually not so complicated to find stuff, but it definitely helps and adds one definite way how to handle this. :+1:

Makman2 commented 7 years ago

For an approach: I think we can orientate on many tests which have a load_testdata-function, which loads a file relative to a directory located in the same directory as the test. So if somebody wants test files:

  1. Create a directory with a certain pattern, like <TestFileName> or <TestFileName>TestFiles
  2. Place test-files inside
  3. Use load_testdata
Mixih commented 6 years ago

assigned per GSoC project "Improve Linter Bears"