twisted / twisted/twisted

add twisted.trial.unittest.mark for marking test functions in a type safe way

Open
#10,221 3 comments 0 reactions 1 assignee View on GitHub

@graingert is already working on this.

Since Jun 28, 2022.

core enhancement new priority-normal
Dominant language
Python
Stars
6k
Forks
1.2k
Avg merge
2d 10h
Merged PRs (30d)
10

Description

graingert's avatar @graingert reported
Trac ID trac#10221
Type enhancement
Created 2021-07-11 13:46:08Z

I want to avoid code like this:

I want to be able to do:

    def test_pass(self):
        ...

    test_pass.timeout = 2  # type: ignore[attr-defined]

but in a type safe way:

    @unittest.mark(timeout=2)
    def test_pass(self):
        ...


    @unittest.mark(timeout="four")  # mypy error!
    def test_eggs(self):
        ...

Searchable metadata
trac-id__10221 10221
type__enhancement enhancement
reporter__graingert graingert
priority__normal normal
milestone__None None
branch__ 
branch_author__ 
status__new new
resolution__None None
component__core core
keywords__None None
time__1626011168755828 1626011168755828
changetime__1642026499116405 1642026499116405
version__None None
owner__graingert graingert

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.