Skip to content

Commit

Permalink
added test for module with non constant gloabal variable
Browse files Browse the repository at this point in the history
  • Loading branch information
nucccc committed May 23, 2024
1 parent 210a456 commit 5b11c4c
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/test_mod_collect.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
testing mod colection functions
'''

import ast

import pytest

from markarth.convert.collect.mod_collect import (
Expand Down Expand Up @@ -74,6 +76,21 @@ def test_collect_const_candidates(mod3):
assert b_typ.is_float()


def test_collect_const_candidates_with_rep(mod3):
mod_ast = ast.parse('a = 3\na = 3.14')

const_candidates = collect_const_candidates(
mod_ast = mod_ast,
all_global_varnames = set()
)

assert len(const_candidates) == 1

a_typ = const_candidates.get_typ('a')
assert a_typ is not None
assert a_typ.is_any()


def test_collect_call_typs(mod3):
mod_ast, _ = mod3

Expand Down

0 comments on commit 5b11c4c

Please sign in to comment.