Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zenlyj committed Mar 30, 2023
1 parent 5969d5e commit 05c7f78
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"""Tests for used-before-assignment when postponed evaluation of annotations is enabled"""
# pylint: disable=missing-function-docstring, invalid-name
from __future__ import annotations
from typing import TYPE_CHECKING

if TYPE_CHECKING:
var = 1
import math

print(var) # [used-before-assignment]

def function_one(m: math): # no error for annotations
return m
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
used-before-assignment:10:6:10:9::Using variable 'var' before assignment:CONTROL_FLOW
2 changes: 1 addition & 1 deletion tests/functional/u/used/used_before_assignment_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
if True: # pylint: disable=using-constant-test
import math
import dbm
print(dbm)
print(dbm) # no error when defined and used in the same false branch
from urllib.request import urlopen
import array
import base64
Expand Down

0 comments on commit 05c7f78

Please sign in to comment.