"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "client/commands/tests/start_test.py" between
pyre-check-0.0.54.tar.gz and pyre-check-0.0.55.tar.gz

About: Pyre is a performant type checker for Python (ships with Pysa, a security focused static analysis tool).

start_test.py  (pyre-check-0.0.54):start_test.py  (pyre-check-0.0.55)
skipping to change at line 444 skipping to change at line 444
store_type_check_resolution=True, store_type_check_resolution=True,
use_watchman=False, use_watchman=False,
incremental_style=commands.IncrementalStyle.FINE_GRAINED, incremental_style=commands.IncrementalStyle.FINE_GRAINED,
configuration=configuration, configuration=configuration,
analysis_directory=AnalysisDirectory("."), analysis_directory=AnalysisDirectory("."),
) )
self.assertEqual( self.assertEqual(
set(command._flags()), {*flags, "-store-type-check-resolution"} set(command._flags()), {*flags, "-store-type-check-resolution"}
) )
# Test ignore all errors. # Test autocomplete.
arguments = mock_arguments() arguments = mock_arguments()
configuration = mock_configuration(version_hash="hash") configuration = mock_configuration(version_hash="hash")
configuration.ignore_all_errors = ["/absolute/a", "/root/b"] configuration.autocomplete = True
command = Start( command = Start(
arguments, arguments,
original_directory, original_directory,
terminal=False, terminal=False,
store_type_check_resolution=False, store_type_check_resolution=False,
use_watchman=True, use_watchman=False,
incremental_style=commands.IncrementalStyle.FINE_GRAINED, incremental_style=commands.IncrementalStyle.FINE_GRAINED,
configuration=configuration, configuration=configuration,
analysis_directory=AnalysisDirectory("."), analysis_directory=AnalysisDirectory("."),
) )
self.assertEqual( self.assertEqual(set(command._flags()), {*flags, "-autocomplete"})
set(command._flags()), {*flags, "-ignore-all-errors", "/absolute/a;/
root/b"}
)
# Test autocomplete. # Test profiling options.
arguments = mock_arguments() arguments = mock_arguments(enable_profiling=True)
configuration = mock_configuration(version_hash="hash") configuration = mock_configuration(version_hash="hash")
configuration.autocomplete = True
command = Start( command = Start(
arguments, arguments,
original_directory, original_directory,
terminal=False, terminal=False,
store_type_check_resolution=False, store_type_check_resolution=False,
use_watchman=False, use_watchman=False,
incremental_style=commands.IncrementalStyle.FINE_GRAINED, incremental_style=commands.IncrementalStyle.FINE_GRAINED,
configuration=configuration, configuration=configuration,
analysis_directory=AnalysisDirectory("."), analysis_directory=AnalysisDirectory("."),
) )
self.assertEqual(set(command._flags()), {*flags, "-autocomplete"}) self.assertEqual(
set(command._flags()), {*flags, "-profiling-output", ".pyre/profilin
g.log"}
)
# Test profiling options. arguments = mock_arguments(enable_memory_profiling=True)
arguments = mock_arguments(enable_profiling=True)
configuration = mock_configuration(version_hash="hash") configuration = mock_configuration(version_hash="hash")
command = Start( command = Start(
arguments, arguments,
original_directory, original_directory,
terminal=False, terminal=False,
store_type_check_resolution=False, store_type_check_resolution=False,
use_watchman=False, use_watchman=False,
incremental_style=commands.IncrementalStyle.FINE_GRAINED, incremental_style=commands.IncrementalStyle.FINE_GRAINED,
configuration=configuration, configuration=configuration,
analysis_directory=AnalysisDirectory("."), analysis_directory=AnalysisDirectory("."),
) )
self.assertEqual( self.assertEqual(
set(command._flags()), {*flags, "-profiling-output", ".pyre/profilin set(command._flags()),
g.log"} {*flags, "-memory-profiling-output", ".pyre/profiling.log"},
) )
arguments = mock_arguments(enable_memory_profiling=True) @patch(
f"{find_directories.__name__}.find_global_and_local_root",
return_value=find_directories.FoundRoot(Path(".")),
)
@patch(_typeshed_search_path, Mock(return_value=["path3"]))
# pyre-fixme[56]: Argument `set()` to decorator factory
# `unittest.mock.patch.object` could not be resolved in a global scope.
@patch.object(commands.Reporting, "_get_directories_to_analyze", return_valu
e=set())
def test_start_flags__ignore_all_errors(
self,
get_directories_to_analyze: MagicMock,
find_global_and_local_root: MagicMock,
) -> None:
original_directory = "/original/directory"
arguments = mock_arguments()
configuration = mock_configuration(version_hash="hash") configuration = mock_configuration(version_hash="hash")
configuration.get_existent_ignore_all_errors_paths.return_value = [
"/absolute/a",
"/root/b",
]
flags = [
"-logging-sections",
"environment,-progress",
"-project-root",
"/root",
"-log-directory",
".pyre",
"-workers",
"5",
"-expected-binary-version",
"hash",
"-search-path",
"path1,path2,path3",
"-new-incremental-check",
]
command = Start( command = Start(
arguments, arguments,
original_directory, original_directory,
terminal=False, terminal=False,
store_type_check_resolution=False, store_type_check_resolution=False,
use_watchman=False, use_watchman=True,
incremental_style=commands.IncrementalStyle.FINE_GRAINED, incremental_style=commands.IncrementalStyle.FINE_GRAINED,
configuration=configuration, configuration=configuration,
analysis_directory=AnalysisDirectory("."), analysis_directory=AnalysisDirectory("."),
) )
self.assertEqual( self.assertEqual(
set(command._flags()), set(command._flags()), {*flags, "-ignore-all-errors", "/absolute/a;/
{*flags, "-memory-profiling-output", ".pyre/profiling.log"}, root/b"}
) )
@patch.object(configuration_monitor.ConfigurationMonitor, "daemonize") @patch.object(configuration_monitor.ConfigurationMonitor, "daemonize")
def test_start_configuration_monitor_watchman_enabled( def test_start_configuration_monitor_watchman_enabled(
self, daemonize: MagicMock self, daemonize: MagicMock
) -> None: ) -> None:
start_command = Start( start_command = Start(
mock_arguments(), mock_arguments(),
"/original/directory", "/original/directory",
terminal=False, terminal=False,
 End of changes. 13 change blocks. 
19 lines changed or deleted 51 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)