File tree Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
55[tool .setuptools_scm ]
66# this is used populated when creating a git archive
77# and when there is .git dir and/or there is no git installed
8- fallback_version = " 9999.$Format:%h-%cs$ "
8+ fallback_version = " 9999.dev99 "
99
1010[tool .pytest .ini_options ]
1111norecursedirs = [
Original file line number Diff line number Diff line change @@ -1840,6 +1840,8 @@ def _populate(self, scan_data):
18401840 ##########################################################
18411841 for attr_name in self .codebase_attributes :
18421842 value = scan_data .get (attr_name )
1843+ if value == None :
1844+ continue
18431845 setattr (self .attributes , attr_name , value )
18441846
18451847 ##########################################################
Original file line number Diff line number Diff line change 1212from os .path import exists
1313from os .path import join
1414
15+ import attr
16+
1517from commoncode .fileutils import parent_directory
1618from commoncode .resource import Codebase
1719from commoncode .resource import Resource
@@ -661,6 +663,17 @@ def test_VirtualCodebase_with_paths_works(self):
661663 )
662664 check_against_expected_json_file (results , expected_file , regen = False )
663665
666+ def test_VirtualCodebase_codebase_attributes_assignment (self ):
667+ test_codebase = self .get_test_loc ('resource/with_path/virtual-codebase.json' )
668+ vc = VirtualCodebase (
669+ location = test_codebase ,
670+ codebase_attributes = dict (
671+ packages = attr .ib (default = attr .Factory (list ))
672+ ),
673+ )
674+ self .assertNotEqual (vc .attributes .packages , None )
675+ self .assertEqual (vc .attributes .packages , [])
676+
664677
665678class TestCodebaseCache (FileBasedTesting ):
666679 test_data_dir = join (dirname (__file__ ), 'data' )
You can’t perform that action at this time.
0 commit comments