示例#1
0
def teardown_function(function):
    _readers.clear()
    _writers.clear()
    _identifiers.clear()
    _readers.update(ORIGINAL['readers'])
    _writers.update(ORIGINAL['writers'])
    _identifiers.update(ORIGINAL['identifiers'])
示例#2
0
def teardown_function(function):
    _readers.clear()
    _writers.clear()
    _identifiers.clear()
    _readers.update(ORIGINAL['readers'])
    _writers.update(ORIGINAL['writers'])
    _identifiers.update(ORIGINAL['identifiers'])
示例#3
0
def test_read_noformat_arbitrary_file(tmpdir):
    """Tests that all identifier functions can accept arbitrary files"""
    _readers.update(_READERS_ORIGINAL)
    testfile = str(tmpdir.join('foo.example'))
    with open(testfile, 'w') as f:
        f.write("Hello world")

    with pytest.raises(io_registry.IORegistryError) as exc:
        Table.read(testfile)
    assert str(exc.value).startswith("Format could not be identified.")
示例#4
0
def test_read_noformat_arbitrary_file(tmpdir):
    """Tests that all identifier functions can accept arbitrary files"""
    _readers.update(ORIGINAL['readers'])
    testfile = str(tmpdir.join('foo.example'))
    with open(testfile, 'w') as f:
        f.write("Hello world")

    with pytest.raises(io_registry.IORegistryError) as exc:
        Table.read(testfile)
    assert str(exc.value).startswith("Format could not be identified.")
示例#5
0
def test_read_noformat_arbitrary_file(tmpdir):
    """Tests that all identifier functions can accept arbitrary files"""
    _readers.update(ORIGINAL['readers'])
    testfile = str(tmpdir.join('foo.example'))
    with open(testfile, 'w') as f:
        f.write("Hello world")

    with pytest.raises(io_registry.IORegistryError) as exc:
        Table.read(testfile)
    assert str(exc.value).startswith("Format could not be identified based on the"
                                     " file name or contents, please provide a"
                                     " 'format' argument.")
示例#6
0
def teardown_function(function):
    _readers.update(_READERS_ORIGINAL)
    _writers.update(_WRITERS_ORIGINAL)
    _identifiers.update(_IDENTIFIERS_ORIGINAL)
示例#7
0
def teardown_function(function):
    _readers.update(_READERS_ORIGINAL)
    _writers.update(_WRITERS_ORIGINAL)
    _identifiers.update(_IDENTIFIERS_ORIGINAL)