Opened 2 years ago

Last modified 6 months ago

#6535 enhancement new

Document that tests should create test data, rather than storing as files in the python path.

Reported by: tom.prince Owned by: adiroiban
Priority: normal Milestone:
Component: core Keywords: documentation policy
Cc: Branch:
Author: Launchpad Bug:


<exarkun> keeping data in the source tree should be avoided where possible
<exarkun> I don't think anyone knows how to avoid it in _all_ cases, but where it's obvious how to do so it seems worthwhile.
<exarkun> And dumping data into a temporary path during the test run opens up more testing opportunities
<exarkun> If the data is part of the shipped source, then it's hard to rely on some of the less obvious properties (permissions, for example)
<exarkun> There's a handful of tests that fail when run against an installed copy of Twisted.  I dunno if this test is one of them, but it suffers from the same problem as the failing tests do, even if it doesn't have the same symptom

Change History (2)

comment:1 Changed 2 years ago by Julian

As per some discussion on #5787 (and some more on IRC with exarkun for which this is a rough summary), we should consider test cases for trial to be an exception on a case-by-case basis when a separate module (to discover) might be necessary. (Though of course defining the auxiliary test code on the test case that needs it is preferable when possible anyhow).

[the rationale being that it is beneficial to be able to invoke bin/trial on the test modules besides their use in the relevant test]

comment:2 Changed 6 months ago by adiroiban

  • Owner set to adiroiban

I will try to solve this ticket.

Note: See TracTickets for help on using tickets.