Replying to cremona:
I have not checked all the logic in the revised code.
I don't think I have explained the issue that this ticket fixes very clearly (which was exposed when running one of the optional doctests without having the optional spkg installed). There are 2 main issues that caused this:
- When calling
CremonaDatabase('name')
the file SAGE_ROOT/data/cremona/name.db
was being touched, something that is bad in general if the file wasn't there to start with.
- When calling
CremonaDatabase()
, to determine if the full database is installed, it would check for the existence of SAGE_ROOT/data/cremona/cremona.db
rather than use one of the functions in sage.misc
for this purpose.
With these combined, running the optional doctests would break the cremona database: it would run CremonaDatabase('cremona')
, which would touch SAGE_ROOT/data/cremona/cremona.db
and thus later calls of CremonaDatabase()
would break since it would think the full cremona database was installed and try to use the touched file.
I was puzzled by the remark about testing with flag --optional since I thought that only made sense with some sensible string after the word "optional", e.g. "magma".
Unless you want to test all optional packages (which could be useful for a giant system install -- unfortunately there are a few optional packages that don't want to build properly at the moment).
But it seems that there are doctest lines which are tagged "# optional" with no mention of which optional package is relevant.
I consider this a bug and something that should be required for any optional tags.