Skip to content

use py.test for testing, refactor tests #28

@ThomasWaldmann

Description

@ThomasWaldmann

pytest is way superior (and also more comfortable) compared to unittest.

less work to write tests, prettier / easier readable tests, more useful output (esp. on failure).

the existing tests can be taken "as is" as a starting point, pytest is able to run them.

later, more pytest specific features can be used to further improve.

be careful!

borg.selftest is special because it must not depend on pytest. it runs every time borg is invoked by a user.

see there: #6157 (comment)

These must not be converted to unittest:

from .testsuite.hashindex import HashIndexDataTestCase, HashIndexRefcountingTestCase, HashIndexTestCase
from .testsuite.crypto import CryptoTestCase
from .testsuite.chunker import ChunkerTestCase

SELFTEST_CASES = [
    HashIndexDataTestCase,
    HashIndexRefcountingTestCase,
    HashIndexTestCase,
    CryptoTestCase,
    ChunkerTestCase,
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions