manuskript/manuskript
Curtis Gedak af53102e77 Fix pytest warning about duplicate name when running tests
When running pytest on kubuntu 16.04 the following warning was displayed:

    $ python3 -m pytest -v
    ...
    ./manuskript/load_save/version_1.py:319: \
    UserWarning: Duplicate name: 'outline/0-Folder/0-Text-3.md'
      zf.writestr(filename, content, compress_type=compression)

The error was tracked down using the following pytest invocation:

    $ python3 -m pytest -v -W error::UserWarning

This invocation showed 4 occurrences similar to the following warning:

    self = <zipfile.ZipFile filename='/tmp/tmpgs_sjpzr.msk' mode='w'>
    zinfo = <[AttributeError("compress_size") raised in repr()] \
    ZipInfo object at 0x7f3cc0124588>

        def _writecheck(self, zinfo):
            """Check for errors before writing a file to the archive."""
            if zinfo.filename in self.NameToInfo:
                import warnings
    >           warnings.warn('Duplicate name: %r' % zinfo.filename, \
                stacklevel=3)
    E           UserWarning: Duplicate name: 'outline/0-Folder/0-Text-3.md'

These warnings arose in the following 4 tests:

  - test_references
  - test_autoLoad
  - test_loadExportWiget
  - test_loadImportWiget

The cause of the issue is that in manuskript/tests/conftest.py, the
mainWindow::closeProject() method is called to close the project, but
the project was never loaded.  This meant the zip file setting
defaulted to True, when in fact the Acts sample project is not stored
in a single zip project file.

Fix by removing the call to MW.closeProject() before the project is
loaded.
2018-11-16 12:52:09 -07:00
..
converters Fix typos in code comments, invisible to end-users. 2018-01-29 10:30:41 -07:00
exporter Improve pandoc compile/export return code handling 2018-10-31 10:31:53 -06:00
functions Adds: clickable links, and display images as tooltips (#22, #215) 2017-12-14 14:55:14 +01:00
importer Fix typos that are visible to end-users. 2018-01-29 10:30:41 -07:00
load_save Fix typos in code comments, invisible to end-users. 2018-01-29 10:30:41 -07:00
models Fix plot importance changes if delete earlier plot and click other plots 2018-11-05 09:29:53 -07:00
tests Fix pytest warning about duplicate name when running tests 2018-11-16 12:52:09 -07:00
ui Fix segmentation fault on import 2018-11-11 13:31:06 -07:00
__init__.py Renaming source folder 2016-02-06 08:38:33 +01:00
enums.py Checkpoint in refactoring outlineItem 2017-11-17 12:16:39 +01:00
loadSave.py Fix typos in code comments, invisible to end-users. 2018-01-29 10:30:41 -07:00
main.py Fix typos in code comments, invisible to end-users. 2018-01-29 10:30:41 -07:00
mainWindow.py Fix plot importance changes if delete earlier plot and click other plots 2018-11-05 09:29:53 -07:00
settings.py Adds "Sentence mode" to Focus mode. #259 2017-12-15 20:56:40 +01:00
settingsWindow.py Add new language translations to the Settings window 2018-08-06 11:27:29 -06:00
version.py ========== manuskript-0.7.0 ========== 2018-08-15 09:25:21 -06:00