├── .gitattributes ├── .github ├── PULL_REQUEST_TEMPLATE.md ├── dependabot.yml └── workflows │ ├── actions │ └── prepare │ │ └── action.yml │ ├── auto-author-assign.yml │ ├── auto-format.yml │ ├── build-wheels.yml │ ├── ci.yml │ └── main.yml ├── .gitignore ├── .go-version ├── .node-version ├── .poetry-version ├── .python-version ├── Dockerfile ├── README.md ├── hstest ├── __init__.py ├── check_result.py ├── common │ ├── __init__.py │ ├── file_utils.py │ ├── os_utils.py │ ├── process_utils.py │ ├── reflection_utils.py │ └── utils.py ├── dynamic │ ├── __init__.py │ ├── dynamic_test.py │ ├── input │ │ ├── __init__.py │ │ ├── dynamic_input_func.py │ │ ├── dynamic_input_handler.py │ │ ├── dynamic_testing.py │ │ ├── input_handler.py │ │ └── input_mock.py │ ├── output │ │ ├── __init__.py │ │ ├── colored_output.py │ │ ├── infinite_loop_detector.py │ │ ├── output_handler.py │ │ └── output_mock.py │ ├── security │ │ ├── __init__.py │ │ ├── exit_exception.py │ │ ├── exit_handler.py │ │ ├── thread_group.py │ │ └── thread_handler.py │ └── system_handler.py ├── exception │ ├── __init__.py │ ├── failure_handler.py │ ├── outcomes.py │ └── testing.py ├── exceptions.py ├── outcomes │ ├── __init__.py │ ├── compilation_error_outcome.py │ ├── error_outcome.py │ ├── exception_outcome.py │ ├── outcome.py │ ├── unexpected_error_outcome.py │ └── wrong_answer_outcome.py ├── stage │ ├── __init__.py │ ├── django_test.py │ ├── flask_test.py │ ├── plotting_test.py │ ├── sql_test.py │ └── stage_test.py ├── stage_test.py ├── test_case │ ├── __init__.py │ ├── attach │ │ ├── __init__.py │ │ ├── django_settings.py │ │ └── flask_settings.py │ ├── check_result.py │ └── test_case.py └── testing │ ├── __init__.py │ ├── execution │ ├── __init__.py │ ├── filtering │ │ ├── __init__.py │ │ ├── file_filter.py │ │ └── main_filter.py │ ├── main_module_executor.py │ ├── process │ │ ├── __init__.py │ │ ├── cpp_executor.py │ │ ├── go_executor.py │ │ ├── javascript_executor.py │ │ ├── python_executor.py │ │ └── shell_executor.py │ ├── process_executor.py │ ├── program_executor.py │ ├── runnable │ │ ├── __init__.py │ │ ├── python_runnable_file.py │ │ └── runnable_file.py │ └── searcher │ │ ├── __init__.py │ │ ├── base_searcher.py │ │ ├── cpp_searcher.py │ │ ├── go_searcher.py │ │ ├── javascript_searcher.py │ │ ├── python_searcher.py │ │ ├── shell_searcher.py │ │ └── sql_searcher.py │ ├── execution_options.py │ ├── plotting │ ├── __init__.py │ ├── drawing │ │ ├── __init__.py │ │ ├── drawing.py │ │ ├── drawing_builder.py │ │ ├── drawing_data.py │ │ ├── drawing_library.py │ │ └── drawing_type.py │ ├── drawing_data_normalizer.py │ ├── matplotlib_handler.py │ ├── pandas_handler.py │ └── seaborn_handler.py │ ├── process_wrapper.py │ ├── runner │ ├── __init__.py │ ├── async_dynamic_testing_runner.py │ ├── django_application_runner.py │ ├── flask_application_runner.py │ ├── plot_testing_runner.py │ ├── sql_runner.py │ └── test_runner.py │ ├── settings.py │ ├── state_machine.py │ ├── test_run.py │ ├── tested_program.py │ └── unittest │ ├── __init__.py │ ├── expected_fail_test.py │ ├── unexepected_error_test.py │ └── user_error_test.py ├── package.json ├── poetry.lock ├── pyproject.toml ├── requirements.txt └── tests ├── __init__.py ├── outcomes ├── command_line_args │ ├── test_command_line_args_changed │ │ ├── main.py │ │ └── test.py │ ├── test_command_line_arguments_failed │ │ ├── main.py │ │ └── test.py │ ├── test_command_line_arguments_failed_2 │ │ ├── main.py │ │ └── test.py │ ├── test_command_line_arguments_failed_dynamic_method │ │ ├── main.py │ │ └── test.py │ ├── test_command_line_arguments_failed_dynamic_method_2 │ │ ├── main.py │ │ └── test.py │ ├── test_command_line_arguments_failed_dynamic_method_3 │ │ ├── main.py │ │ ├── main2.py │ │ └── test.py │ ├── test_command_line_arguments_failed_dynamic_method_4 │ │ ├── main.py │ │ ├── main2.py │ │ └── test.py │ ├── test_command_line_arguments_failed_dynamic_method_5 │ │ ├── main.py │ │ ├── main2.py │ │ └── test.py │ ├── test_command_line_arguments_failed_dynamic_testing │ │ ├── main.py │ │ └── test.py │ ├── test_command_line_arguments_failed_dynamic_testing_2 │ │ ├── main.py │ │ └── test.py │ ├── test_command_line_arguments_failed_dynamic_testing_3 │ │ ├── main.py │ │ ├── main2.py │ │ └── test.py │ ├── test_command_line_arguments_failed_dynamic_testing_4 │ │ ├── main.py │ │ ├── main2.py │ │ └── test.py │ ├── test_command_line_arguments_failed_dynamic_testing_5 │ │ ├── main.py │ │ ├── main2.py │ │ └── test.py │ ├── test_command_line_arguments_failed_second_test │ │ ├── main.py │ │ └── test.py │ ├── test_command_line_arguments_failed_second_test_dynamic_method │ │ ├── main.py │ │ ├── main2.py │ │ └── test.py │ ├── test_command_line_arguments_failed_second_test_dynamic_testing │ │ ├── main.py │ │ ├── main2.py │ │ └── test.py │ ├── test_command_line_arguments_failed_with_spaces │ │ ├── main.py │ │ └── test.py │ ├── test_command_line_arguments_passing │ │ ├── main.py │ │ └── test.py │ ├── test_command_line_arguments_passing_dynamic_method │ │ ├── main.py │ │ └── test.py │ └── test_command_line_arguments_passing_dynamic_testing │ │ ├── main.py │ │ └── test.py ├── dynamic_input │ ├── success_dynamic_input │ │ ├── main.py │ │ └── test.py │ ├── test_dynamic_input │ │ ├── main.py │ │ └── test.py │ ├── test_dynamic_input_fail_infinite_loop │ │ ├── main.py │ │ └── test.py │ ├── test_dynamic_input_fail_infinite_loop_2 │ │ ├── main.py │ │ └── test.py │ └── test_multiple_dynamic_inputs │ │ ├── main.py │ │ └── test.py ├── dynamic_method │ ├── test_dont_return_output_after_execution │ │ ├── main.py │ │ └── test.py │ ├── test_dynamic_method_accepted_simple │ │ ├── main.py │ │ └── test.py │ ├── test_dynamic_method_early_exit │ │ ├── main.py │ │ └── test.py │ ├── test_dynamic_method_exception │ │ ├── main.py │ │ └── test.py │ ├── test_dynamic_method_program_not_finished_after_test │ │ ├── main.py │ │ └── test.py │ ├── test_dynamic_method_program_not_finished_after_test_but_exception_happened │ │ ├── main.py │ │ └── test.py │ ├── test_dynamic_method_program_not_finished_after_test_but_shut_down_module │ │ ├── main.py │ │ └── test.py │ ├── test_dynamic_method_program_not_finished_after_test_but_shut_down_process │ │ ├── main.py │ │ └── test.py │ ├── test_dynamic_method_start_in_background_correct │ │ ├── main.py │ │ └── test.py │ ├── test_dynamic_method_start_in_background_wrong_answer │ │ ├── main.py │ │ └── test.py │ ├── test_dynamic_method_unexpected_error_no_check_method │ │ ├── main.py │ │ └── test.py │ ├── test_dynamic_method_with_generating_test_cases │ │ └── test.py │ ├── test_dynamic_method_wrong_answer_in_check_method │ │ ├── main.py │ │ └── test.py │ ├── test_feedback │ │ └── test.py │ ├── test_files │ │ └── test.py │ ├── test_getting_output_while_program_in_background │ │ ├── main.py │ │ └── test.py │ └── test_right_sequence_of_tests │ │ └── test.py ├── dynamic_output │ ├── test_dynamic_output │ │ ├── main.py │ │ └── test.py │ ├── test_dynamic_output_with_input │ │ ├── main.py │ │ └── test.py │ └── test_dynamic_output_without_input │ │ ├── main.py │ │ └── test.py ├── feedback_on_exception │ ├── feedback_on_exception_test_1 │ │ ├── main.py │ │ └── test.py │ ├── feedback_on_exception_test_2 │ │ ├── main.py │ │ └── test.py │ ├── feedback_on_exception_test_3 │ │ ├── main.py │ │ └── test.py │ ├── feedback_on_exception_test_4 │ │ ├── main.py │ │ └── test.py │ ├── feedback_on_exception_test_5_module │ │ ├── main.py │ │ └── test.py │ └── feedback_on_exception_test_5_process │ │ ├── main.py │ │ └── test.py ├── imports │ ├── not_fallback_on_not_found_executabe_file │ │ ├── dir1 │ │ │ └── main.py │ │ └── test.py │ ├── test_import_absolute │ │ ├── random_module │ │ │ ├── main.py │ │ │ └── main2.py │ │ └── test.py │ ├── test_import_absolute_2 │ │ ├── random_module │ │ │ ├── main.py │ │ │ └── main2.py │ │ └── test.py │ ├── test_import_absolute_error │ │ ├── main.py │ │ ├── main2.py │ │ └── test.py │ ├── test_import_absolute_error_2 │ │ ├── main.py │ │ ├── main2.py │ │ └── test.py │ ├── test_import_absolute_error_circular │ │ ├── main.py │ │ ├── main2.py │ │ └── test.py │ ├── test_import_absolute_error_circular_2 │ │ ├── main.py │ │ ├── main2.py │ │ └── test.py │ ├── test_import_absolute_error_circular_3 │ │ ├── main.py │ │ ├── main2.py │ │ └── test.py │ ├── test_import_absolute_error_circular_4 │ │ ├── main.py │ │ ├── main2.py │ │ └── test.py │ ├── test_import_absolute_error_circular_5 │ │ ├── main.py │ │ ├── main2.py │ │ └── test.py │ ├── test_import_absolute_error_circular_6 │ │ ├── main.py │ │ ├── main2.py │ │ └── test.py │ ├── test_import_package │ │ ├── random_module │ │ │ ├── in1 │ │ │ │ └── in2 │ │ │ │ │ └── main2.py │ │ │ └── main.py │ │ └── test.py │ ├── test_import_package_2 │ │ ├── random_module │ │ │ ├── in1 │ │ │ │ └── in2 │ │ │ │ │ └── main2.py │ │ │ └── main.py │ │ └── test.py │ ├── test_import_package_3 │ │ ├── random_module │ │ │ ├── in1 │ │ │ │ ├── file.py │ │ │ │ └── in2 │ │ │ │ │ └── main2.py │ │ │ └── main.py │ │ └── test.py │ ├── test_import_package_4 │ │ ├── random_module │ │ │ ├── in1 │ │ │ │ ├── file.py │ │ │ │ └── in2 │ │ │ │ │ └── main2.py │ │ │ └── main.py │ │ └── test.py │ ├── test_import_package_5 │ │ ├── random_module │ │ │ ├── in1 │ │ │ │ ├── file.py │ │ │ │ └── in2 │ │ │ │ │ └── main2.py │ │ │ └── main.py │ │ └── test.py │ ├── test_import_package_6 │ │ ├── random_module │ │ │ ├── in1 │ │ │ │ ├── file.py │ │ │ │ └── in2 │ │ │ │ │ └── main2.py │ │ │ └── main.py │ │ └── test.py │ ├── test_import_package_7 │ │ ├── random_module │ │ │ ├── in1 │ │ │ │ ├── file.py │ │ │ │ └── in2 │ │ │ │ │ └── main2.py │ │ │ └── main.py │ │ └── test.py │ ├── test_import_relative │ │ ├── main.py │ │ ├── main2.py │ │ └── test.py │ ├── test_import_relative_error │ │ ├── main.py │ │ ├── main2.py │ │ └── test.py │ ├── test_import_relative_error_2 │ │ ├── main.py │ │ ├── main2.py │ │ └── test.py │ ├── test_import_relative_error_cilcullar │ │ ├── main.py │ │ ├── main2.py │ │ └── test.py │ ├── test_two_files_suits_but_we_have_source │ │ ├── main1.py │ │ ├── main2.py │ │ └── test.py │ ├── test_two_files_suits_but_we_have_source_2 │ │ ├── main1.py │ │ ├── main2.py │ │ └── test.py │ ├── test_two_files_suits_but_we_have_source_3 │ │ ├── main1.py │ │ ├── main2.py │ │ └── test.py │ ├── test_two_files_suits_but_we_have_source_4 │ │ ├── main1.py │ │ ├── main2.py │ │ └── test.py │ ├── test_two_files_suits_but_we_have_source_5 │ │ ├── main1.py │ │ ├── main2.py │ │ └── test.py │ ├── test_two_files_suits_but_we_have_source_6 │ │ ├── main1.py │ │ ├── main2.py │ │ └── test.py │ ├── test_two_files_suits_but_we_have_source_7 │ │ ├── main1.py │ │ ├── main2.py │ │ └── test.py │ ├── test_two_files_suits_but_we_have_source_8 │ │ ├── main1.py │ │ ├── main2.py │ │ └── test.py │ ├── test_two_files_suits_but_we_have_source_9 │ │ ├── main1.py │ │ ├── main2.py │ │ └── test.py │ ├── user_main_file_not_exists │ │ └── test.py │ ├── user_main_file_not_exists_but_exists_other │ │ ├── main.py │ │ └── test.py │ ├── user_module_not_exists │ │ └── test.py │ └── user_module_not_exists_but_exists_other │ │ ├── random_module │ │ └── main.py │ │ └── test.py ├── infinite_loop │ ├── infinite_loop_test_char │ │ ├── main.py │ │ └── test.py │ ├── infinite_loop_test_input_request │ │ ├── main.py │ │ └── test.py │ ├── infinite_loop_test_line_1 │ │ ├── main.py │ │ └── test.py │ ├── infinite_loop_test_line_10 │ │ ├── main.py │ │ └── test.py │ ├── infinite_loop_test_line_11 │ │ ├── main.py │ │ └── test.py │ ├── infinite_loop_test_line_2 │ │ ├── main.py │ │ └── test.py │ ├── infinite_loop_test_line_3 │ │ ├── main.py │ │ └── test.py │ ├── infinite_loop_test_line_4 │ │ ├── main.py │ │ └── test.py │ ├── infinite_loop_test_line_5 │ │ ├── main.py │ │ └── test.py │ ├── infinite_loop_test_line_6 │ │ ├── main.py │ │ └── test.py │ ├── infinite_loop_test_line_7 │ │ ├── main.py │ │ └── test.py │ ├── infinite_loop_test_line_8 │ │ ├── main.py │ │ └── test.py │ ├── infinite_loop_test_line_9 │ │ ├── main.py │ │ └── test.py │ └── infinite_loop_test_not_working │ │ ├── main.py │ │ └── test.py ├── input_handle │ ├── exception_while_reading │ │ ├── main.py │ │ └── test.py │ ├── exception_while_reading_2 │ │ ├── main.py │ │ └── test.py │ ├── success_but_not_used_input_1 │ │ ├── main.py │ │ └── test.py │ ├── success_but_not_used_input_2 │ │ ├── main.py │ │ └── test.py │ ├── test_not_run_not_needed_input_funcs │ │ ├── main.py │ │ └── test.py │ ├── test_out_of_input_1 │ │ ├── main.py │ │ └── test.py │ ├── test_out_of_input_2 │ │ ├── main.py │ │ └── test.py │ ├── test_out_of_input_3 │ │ ├── main.py │ │ └── test.py │ └── test_out_of_input_4 │ │ ├── main.py │ │ └── test.py ├── lib │ ├── exception_in_user_code │ │ ├── main.py │ │ └── test.py │ ├── exception_in_user_code_2 │ │ ├── main.py │ │ └── test.py │ ├── exception_in_user_code_3 │ │ ├── module │ │ │ └── main.py │ │ └── test.py │ ├── order │ │ └── test_order_complex │ │ │ ├── main.py │ │ │ └── test.py │ ├── success │ │ ├── main.py │ │ └── test.py │ ├── success2 │ │ ├── folder │ │ │ └── main.py │ │ └── test.py │ ├── test_case_same_objects │ │ ├── main.py │ │ └── test.py │ ├── test_copy_to_attach │ │ ├── main.py │ │ └── test.py │ ├── test_curr_test_case │ │ ├── main.py │ │ └── test.py │ ├── test_curr_test_num │ │ ├── main.py │ │ └── test.py │ ├── test_custom_checker │ │ ├── main.py │ │ └── test.py │ ├── test_custom_checker_fail │ │ ├── main.py │ │ └── test.py │ ├── test_nbsp_in_output │ │ ├── main.py │ │ └── test.py │ └── test_run_test_inside_test │ │ ├── main.py │ │ └── test.py ├── long_output │ ├── long_output_on_raise_wrong_answer │ │ ├── main.py │ │ └── test.py │ ├── long_output_on_unexpected_error │ │ ├── main.py │ │ └── test.py │ ├── long_output_with_arguments │ │ ├── main.py │ │ └── test.py │ ├── test_label_on_long_output │ │ ├── main.py │ │ └── test.py │ ├── test_label_on_not_enough_long_output │ │ ├── main.py │ │ └── test.py │ └── wrong_output_with_too_long_output │ │ ├── main.py │ │ └── test.py ├── multiple_empty_line_in_input │ ├── test_input_method_with_multiple_empty_line_input │ │ ├── main.py │ │ └── test.py │ ├── test_multiple_line_at_the_end_and_in_the_middle_of_input │ │ ├── main.py │ │ └── test.py │ └── test_multiple_line_at_the_end_of_input │ │ ├── main.py │ │ └── test.py ├── parametrized_tests │ ├── correct │ │ ├── test_parametrized_data │ │ │ └── test.py │ │ ├── test_parametrized_data_2 │ │ │ └── test.py │ │ ├── test_parametrized_data_3 │ │ │ └── test.py │ │ ├── test_parametrized_data_4 │ │ │ └── test.py │ │ └── test_parametrized_data_5 │ │ │ └── test.py │ └── wrong │ │ ├── test_wrong_data │ │ └── test.py │ │ └── test_wrong_data_2 │ │ └── test.py ├── plot │ ├── area │ │ ├── pandas │ │ │ ├── main.py │ │ │ └── test.py │ │ └── test_area_drawing.py │ ├── bar │ │ ├── matplotlib │ │ │ ├── main.py │ │ │ └── test.py │ │ ├── pandas │ │ │ ├── test_example │ │ │ │ ├── ab_test.csv │ │ │ │ ├── cleaning.py │ │ │ │ └── test.py │ │ │ └── test_no_args │ │ │ │ ├── pandas_dataframe_plot_no_x_no_y.py │ │ │ │ └── test.py │ │ ├── seaborn │ │ │ ├── main.py │ │ │ └── test.py │ │ ├── test_bar_drawing.py │ │ └── universal_tests │ │ │ ├── data_no_x │ │ │ ├── pandas_column_plot.py │ │ │ ├── pandas_column_plot_kind.py │ │ │ ├── pandas_column_string_plot.py │ │ │ ├── pandas_column_string_plot_kind.py │ │ │ ├── pandas_dataframe_plot.py │ │ │ ├── pandas_dataframe_plot_kind.py │ │ │ ├── pandas_dataframe_plot_kind_y.py │ │ │ ├── pandas_dataframe_plot_y.py │ │ │ ├── pandas_series_plot.py │ │ │ ├── pandas_series_plot_kind.py │ │ │ └── test.py │ │ │ ├── data_simple │ │ │ ├── matplotlib_data_dataframe_ax.py │ │ │ ├── matplotlib_data_dataframe_plt.py │ │ │ ├── matplotlib_x_array_ax.py │ │ │ ├── matplotlib_x_array_plt.py │ │ │ ├── matplotlib_x_column_ax.py │ │ │ ├── matplotlib_x_column_plt.py │ │ │ ├── matplotlib_x_column_string_ax.py │ │ │ ├── matplotlib_x_column_string_plt.py │ │ │ ├── matplotlib_x_dataframe_ax.py │ │ │ ├── matplotlib_x_dataframe_plt.py │ │ │ ├── matplotlib_x_list_ax.py │ │ │ ├── matplotlib_x_list_plt.py │ │ │ ├── matplotlib_x_series_ax.py │ │ │ ├── matplotlib_x_series_plt.py │ │ │ ├── matplotlib_x_tuple_ax.py │ │ │ ├── matplotlib_x_tuple_plt.py │ │ │ ├── pandas_dataframe_plot_kind_x.py │ │ │ ├── pandas_dataframe_plot_kind_xy.py │ │ │ ├── pandas_dataframe_plot_x.py │ │ │ ├── pandas_dataframe_plot_xy.py │ │ │ ├── pandas_series_plot_kind.py │ │ │ └── test.py │ │ │ ├── data_two_pics │ │ │ ├── pandas_dataframe_plot_kind_x.py │ │ │ ├── pandas_dataframe_plot_kind_xy.py │ │ │ ├── pandas_dataframe_plot_x.py │ │ │ ├── pandas_dataframe_plot_xy.py │ │ │ └── test.py │ │ │ └── data_two_pics_no_x │ │ │ ├── pandas_dataframe_plot.py │ │ │ ├── pandas_dataframe_plot_kind.py │ │ │ ├── pandas_dataframe_plot_kind_y.py │ │ │ ├── pandas_dataframe_plot_y.py │ │ │ └── test.py │ ├── box │ │ ├── matplotlib │ │ │ ├── test_data │ │ │ │ ├── main.py │ │ │ │ └── test.py │ │ │ └── test_data_2 │ │ │ │ ├── main.py │ │ │ │ ├── test.py │ │ │ │ └── test │ │ │ │ ├── general.csv │ │ │ │ ├── prenatal.csv │ │ │ │ └── sports.csv │ │ ├── pandas │ │ │ ├── main.py │ │ │ └── test.py │ │ ├── seaborn │ │ │ ├── main.py │ │ │ └── test.py │ │ └── test_box_drawing.py │ ├── cat │ │ ├── seaborn │ │ │ ├── main.py │ │ │ └── test.py │ │ └── test_cat_drawing.py │ ├── dis │ │ ├── pandas │ │ │ ├── main.py │ │ │ └── test.py │ │ ├── seaborn │ │ │ ├── main.py │ │ │ └── test.py │ │ └── test_dis_drawing.py │ ├── heatmap │ │ ├── matplotlib │ │ │ ├── main.py │ │ │ └── test.py │ │ ├── seaborn │ │ │ ├── main.py │ │ │ └── test.py │ │ └── test_heatmap_drawing.py │ ├── hexbin │ │ ├── pandas │ │ │ ├── main.py │ │ │ └── test.py │ │ └── test_hexbin_drawing.py │ ├── hist │ │ ├── matplotlib │ │ │ ├── test_data │ │ │ │ ├── main.py │ │ │ │ └── test.py │ │ │ ├── test_sorting_data │ │ │ │ ├── main.py │ │ │ │ └── test.py │ │ │ └── todo │ │ │ │ ├── x_data_with_weights_plt │ │ │ │ ├── main.py │ │ │ │ └── test.py │ │ │ │ └── x_dataframe_plt │ │ │ │ ├── main.py │ │ │ │ └── test.py │ │ ├── pandas │ │ │ ├── test_data │ │ │ │ ├── main.py │ │ │ │ └── test.py │ │ │ ├── test_group_by │ │ │ │ ├── ab_test.csv │ │ │ │ ├── main.py │ │ │ │ └── test.py │ │ │ └── test_sorting_data │ │ │ │ ├── main.py │ │ │ │ └── test.py │ │ ├── seaborn │ │ │ ├── test_data │ │ │ │ ├── main.py │ │ │ │ └── test.py │ │ │ └── test_sorting_data │ │ │ │ ├── main.py │ │ │ │ └── test.py │ │ ├── test_hist_drawing.py │ │ └── universal_tests │ │ │ ├── data_simple │ │ │ ├── matplotlib_data_dataframe_ax.py │ │ │ ├── matplotlib_data_dataframe_plt.py │ │ │ ├── matplotlib_x_array_ax.py │ │ │ ├── matplotlib_x_array_plt.py │ │ │ ├── matplotlib_x_column_ax.py │ │ │ ├── matplotlib_x_column_plt.py │ │ │ ├── matplotlib_x_column_string_ax.py │ │ │ ├── matplotlib_x_column_string_plt.py │ │ │ ├── matplotlib_x_dataframe_ax.py │ │ │ ├── matplotlib_x_dataframe_plt.py │ │ │ ├── matplotlib_x_list_ax.py │ │ │ ├── matplotlib_x_list_plt.py │ │ │ ├── matplotlib_x_series_ax.py │ │ │ ├── matplotlib_x_series_plt.py │ │ │ ├── matplotlib_x_tuple_ax.py │ │ │ ├── matplotlib_x_tuple_plt.py │ │ │ ├── pandas_column.py │ │ │ ├── pandas_column_plot.py │ │ │ ├── pandas_column_plot_kind.py │ │ │ ├── pandas_column_string.py │ │ │ ├── pandas_column_string_plot.py │ │ │ ├── pandas_column_string_plot_kind.py │ │ │ ├── pandas_dataframe.py │ │ │ ├── pandas_dataframe_column.py │ │ │ ├── pandas_dataframe_plot.py │ │ │ ├── pandas_dataframe_plot_column.py │ │ │ ├── pandas_dataframe_plot_kind.py │ │ │ ├── pandas_dataframe_plot_kind_column.py │ │ │ ├── pandas_dataframe_plot_kind_x.py │ │ │ ├── pandas_dataframe_plot_kind_xy.py │ │ │ ├── pandas_dataframe_plot_kind_y.py │ │ │ ├── pandas_dataframe_plot_x.py │ │ │ ├── pandas_dataframe_plot_xy.py │ │ │ ├── pandas_dataframe_plot_y.py │ │ │ ├── pandas_series.py │ │ │ ├── pandas_series_plot.py │ │ │ ├── pandas_series_plot_kind.py │ │ │ ├── seaborn_array.py │ │ │ ├── seaborn_column.py │ │ │ ├── seaborn_column_string.py │ │ │ ├── seaborn_dataframe.py │ │ │ ├── seaborn_dataframe_x.py │ │ │ ├── seaborn_dataframe_xy.py │ │ │ ├── seaborn_dataframe_y.py │ │ │ ├── seaborn_list.py │ │ │ ├── seaborn_series.py │ │ │ ├── seaborn_tuple.py │ │ │ └── test.py │ │ │ └── data_two_pics │ │ │ ├── matplotlib_x_arrays_ax.py │ │ │ ├── matplotlib_x_arrays_plt.py │ │ │ ├── matplotlib_x_columns_ax.py │ │ │ ├── matplotlib_x_columns_plt.py │ │ │ ├── matplotlib_x_lists_ax.py │ │ │ ├── matplotlib_x_lists_plt.py │ │ │ ├── matplotlib_x_tuples_ax.py │ │ │ ├── matplotlib_x_tuples_plt.py │ │ │ ├── pandas_column_hist_by.py │ │ │ ├── pandas_column_string_hist_by.py │ │ │ ├── pandas_dataframe_hist.py │ │ │ ├── pandas_dataframe_hist_by_dataframe.py │ │ │ ├── pandas_dataframe_hist_by_str.py │ │ │ ├── pandas_dataframe_plot_hist.py │ │ │ ├── pandas_dataframe_plot_hist_by.py │ │ │ ├── pandas_dataframe_plot_kind_hist.py │ │ │ ├── pandas_dataframe_plot_kind_hist_by.py │ │ │ ├── pandas_series_hist_by.py │ │ │ ├── seaborn_histplot_array.py │ │ │ ├── seaborn_histplot_dataframe.py │ │ │ ├── seaborn_histplot_dataframe_hue.py │ │ │ ├── seaborn_histplot_list.py │ │ │ ├── seaborn_histplot_tuple.py │ │ │ └── test.py │ ├── line │ │ ├── matplotlib │ │ │ ├── main.py │ │ │ └── test.py │ │ ├── pandas │ │ │ ├── main.py │ │ │ └── test.py │ │ ├── seaborn │ │ │ ├── main.py │ │ │ └── test.py │ │ └── test_line_drawing.py │ ├── lm │ │ ├── seaborn │ │ │ ├── main.py │ │ │ └── test.py │ │ └── test_lm_drawing.py │ ├── pie │ │ ├── test_pie_drawing.py │ │ └── universal_tests │ │ │ ├── data_no_label │ │ │ ├── matplotlib_y_array_ax.py │ │ │ ├── matplotlib_y_array_plt.py │ │ │ ├── matplotlib_y_nparray_ax.py │ │ │ ├── matplotlib_y_nparray_plt.py │ │ │ ├── matplotlib_y_tuple_ax.py │ │ │ ├── matplotlib_y_tuple_plt.py │ │ │ └── test.py │ │ │ ├── data_simple │ │ │ ├── matplotlib_y_array_ax.py │ │ │ ├── matplotlib_y_array_plt.py │ │ │ ├── matplotlib_y_nparray_ax.py │ │ │ ├── matplotlib_y_nparray_plt.py │ │ │ ├── matplotlib_y_tuple_ax.py │ │ │ ├── matplotlib_y_tuple_plt.py │ │ │ ├── pandas_dataframe_plot_kind_y.py │ │ │ ├── pandas_dataframe_plot_y.py │ │ │ ├── pandas_series_plot_kind_y.py │ │ │ ├── pandas_series_plot_y.py │ │ │ └── test.py │ │ │ └── data_two_pics │ │ │ ├── pandas_dataframe_plot.py │ │ │ ├── pandas_dataframe_plot_kind.py │ │ │ └── test.py │ ├── scatter │ │ ├── matplotlib │ │ │ ├── main.py │ │ │ └── test.py │ │ ├── pandas │ │ │ ├── main.py │ │ │ └── test.py │ │ ├── seaborn │ │ │ ├── main.py │ │ │ └── test.py │ │ └── test_scatter_drawing.py │ ├── test_matplotlib │ │ └── test_revert │ │ │ ├── main.py │ │ │ └── test.py │ ├── test_pandas │ │ └── test_revert │ │ │ ├── main.py │ │ │ └── test.py │ ├── test_seaborn │ │ └── test_revert │ │ │ ├── main.py │ │ │ └── test.py │ ├── universal_test.py │ └── violinplot │ │ ├── matplotlib │ │ ├── main.py │ │ └── test.py │ │ ├── seaborn │ │ ├── main.py │ │ └── test.py │ │ └── test_violin_drawing.py ├── repeating │ ├── test_repeating │ │ └── test.py │ ├── test_repeating_2 │ │ └── test.py │ ├── test_repeating_3 │ │ └── test.py │ ├── test_repeating_with_parametrized_tests │ │ └── test.py │ └── test_repeating_wrong_amount │ │ └── test.py ├── runtime_exit │ ├── test_quit │ │ ├── main.py │ │ └── test.py │ ├── unexpected_error_runtime_exit_in_check │ │ ├── main.py │ │ └── test.py │ ├── unexpected_error_runtime_exit_in_dynamic_input │ │ ├── main.py │ │ └── test.py │ └── unexpected_error_runtime_exit_in_generate │ │ ├── main.py │ │ └── test.py ├── search │ └── go_files │ │ ├── go_files1 │ │ ├── another.go │ │ ├── main.go │ │ └── tests.py │ │ ├── go_files2 │ │ ├── another.go │ │ ├── main.go │ │ └── tests.py │ │ └── go_files3 │ │ ├── another.go │ │ ├── main.go │ │ └── tests.py ├── separate_package │ ├── find_module_no_info │ │ ├── dir │ │ │ └── main.py │ │ └── test.py │ ├── find_module_no_info_analyze_imports │ │ ├── dir │ │ │ ├── main.py │ │ │ ├── main2.py │ │ │ ├── main3.py │ │ │ └── main4.py │ │ └── test.py │ ├── find_module_no_info_analyze_imports_2 │ │ ├── dir │ │ │ ├── main.py │ │ │ ├── main2.py │ │ │ ├── main3.py │ │ │ └── main4.py │ │ └── test.py │ ├── find_module_no_info_analyze_imports_3 │ │ ├── dir │ │ │ ├── main.py │ │ │ ├── main2.py │ │ │ ├── main3.py │ │ │ └── main4.py │ │ └── test.py │ ├── find_module_no_info_analyze_name_main │ │ ├── dir │ │ │ ├── main.py │ │ │ ├── main2.py │ │ │ ├── main3.py │ │ │ └── main4.py │ │ └── test.py │ ├── find_module_no_info_analyze_name_main_2 │ │ ├── dir │ │ │ ├── main.py │ │ │ ├── main2.py │ │ │ ├── main3.py │ │ │ └── main4.py │ │ └── test.py │ ├── find_module_no_info_analyze_name_main_3 │ │ ├── dir │ │ │ ├── main.py │ │ │ ├── main2.py │ │ │ ├── main3.py │ │ │ └── main4.py │ │ └── test.py │ └── find_module_no_info_analyze_name_main_4 │ │ ├── dir │ │ ├── main.py │ │ ├── main2.py │ │ ├── main3.py │ │ └── main4.py │ │ └── test.py ├── simple_test │ ├── test_simple_test_case │ │ ├── main.py │ │ └── test.py │ └── test_simple_test_case_fail │ │ ├── main.py │ │ └── test.py ├── stderr │ ├── disable_catching_stderr │ │ ├── main.py │ │ └── test.py │ └── dynamically_change_stderr_catching │ │ ├── main.py │ │ └── test.py ├── stderr_on_unexpected_error │ ├── with_args │ │ ├── test_output_with_stderr_and_with_stdout │ │ │ ├── main.py │ │ │ └── test.py │ │ ├── test_output_with_stdout_and_without_stderr │ │ │ ├── main.py │ │ │ └── test.py │ │ ├── test_output_without_stderr_and_without_stdout │ │ │ ├── main.py │ │ │ └── test.py │ │ └── test_output_without_stdout_and_with_stderr │ │ │ ├── main.py │ │ │ └── test.py │ └── without_args │ │ ├── test_output_with_stderr_and_with_stdout │ │ ├── main.py │ │ └── test.py │ │ ├── test_output_with_stdout_and_without_stderr │ │ ├── main.py │ │ └── test.py │ │ ├── test_output_without_stderr_and_without_stdout │ │ ├── main.py │ │ └── test.py │ │ └── test_output_without_stdout_and_with_stderr │ │ ├── main.py │ │ └── test.py ├── syntax_error │ ├── test_empty_eval │ │ ├── main.py │ │ └── test.py │ ├── test_error_using_eval │ │ ├── main.py │ │ └── test.py │ ├── test_error_using_eval_and_print │ │ ├── main.py │ │ └── test.py │ ├── test_error_using_exec │ │ ├── main.py │ │ └── test.py │ ├── test_syntax_error_1 │ │ ├── main.py │ │ └── test.py │ └── test_syntax_error_2 │ │ ├── main.py │ │ └── test.py ├── test_passed_thrown │ ├── test_passed_thrown_in_check_1 │ │ ├── main.py │ │ └── test.py │ ├── test_passed_thrown_in_check_2 │ │ ├── main.py │ │ └── test.py │ ├── test_passed_thrown_in_dynamic_input_1 │ │ ├── main.py │ │ └── test.py │ └── test_passed_thrown_in_dynamic_input_2 │ │ ├── main.py │ │ └── test.py ├── timeout │ ├── test_default_time_limit │ │ ├── main.py │ │ └── test.py │ ├── test_no_time_limit │ │ ├── main.py │ │ └── test.py │ ├── test_timeout_1 │ │ ├── main.py │ │ └── test.py │ ├── test_timeout_2 │ │ ├── main.py │ │ └── test.py │ └── test_timeout_3 │ │ ├── main.py │ │ └── test.py ├── unexpected_error │ ├── unexpected_error_add_input_1 │ │ ├── main.py │ │ └── test.py │ ├── unexpected_error_add_input_2 │ │ ├── main.py │ │ └── test.py │ ├── unexpected_error_add_input_3 │ │ ├── main.py │ │ └── test.py │ ├── unexpected_error_during_checking │ │ ├── main.py │ │ └── test.py │ ├── unexpected_error_during_checking_with_assertion │ │ ├── main.py │ │ └── test.py │ ├── unexpected_error_empty_test_cases │ │ ├── main.py │ │ └── test.py │ ├── unexpected_error_generating_tests │ │ ├── main.py │ │ └── test.py │ ├── unexpected_error_generating_tests_with_assertion │ │ ├── main.py │ │ └── test.py │ ├── unexpected_error_no_check_method │ │ ├── main.py │ │ └── test.py │ └── unexpected_error_not_generating_tests │ │ ├── main.py │ │ └── test.py ├── wrong_answer │ ├── wrong_answer_dynamic_input_1 │ │ ├── main.py │ │ └── test.py │ ├── wrong_answer_dynamic_input_2 │ │ ├── main.py │ │ └── test.py │ ├── wrong_answer_dynamic_input_3 │ │ ├── main.py │ │ └── test.py │ ├── wrong_answer_dynamic_input_4 │ │ ├── main.py │ │ └── test.py │ ├── wrong_answer_in_test_1 │ │ ├── main.py │ │ └── test.py │ └── wrong_answer_in_test_2 │ │ ├── main.py │ │ └── test.py └── wrong_answer_thrown │ ├── wrong_answer_thrown_in_check_1 │ ├── main.py │ └── test.py │ ├── wrong_answer_thrown_in_check_2 │ ├── main.py │ └── test.py │ ├── wrong_answer_thrown_in_dynamic_input_1 │ ├── main.py │ └── test.py │ └── wrong_answer_thrown_in_dynamic_input_2 │ ├── main.py │ └── test.py ├── projects ├── go │ └── coffee_machine │ │ ├── stage1 │ │ ├── main.go │ │ └── tests.py │ │ ├── stage1_ce │ │ ├── main.go │ │ └── tests.py │ │ ├── stage1_ex │ │ ├── main.go │ │ └── tests.py │ │ ├── stage1_wa │ │ ├── main.go │ │ └── tests.py │ │ ├── stage2 │ │ ├── main.go │ │ └── tests.py │ │ ├── stage3 │ │ ├── main.go │ │ └── tests.py │ │ ├── stage4 │ │ ├── main.go │ │ └── tests.py │ │ └── stage5 │ │ ├── main.go │ │ └── tests.py ├── javascript │ ├── coffee_machine │ │ ├── stage1 │ │ │ ├── main.js │ │ │ └── tests.py │ │ ├── stage1_ce │ │ │ ├── main.js │ │ │ └── tests.py │ │ ├── stage1_ex │ │ │ ├── main.js │ │ │ └── tests.py │ │ ├── stage1_wa │ │ │ ├── main.js │ │ │ └── tests.py │ │ ├── stage2 │ │ │ ├── main.js │ │ │ └── tests.py │ │ ├── stage3 │ │ │ ├── main.js │ │ │ └── tests.py │ │ ├── stage4 │ │ │ ├── main.js │ │ │ └── tests.py │ │ └── stage5 │ │ │ ├── main.js │ │ │ └── tests.py │ ├── simple_chatty_bot │ │ ├── stage1 │ │ │ ├── main.js │ │ │ └── tests.py │ │ ├── stage2 │ │ │ ├── main.js │ │ │ └── tests.py │ │ ├── stage3 │ │ │ ├── main.js │ │ │ └── tests.py │ │ ├── stage4 │ │ │ ├── main.js │ │ │ └── tests.py │ │ └── stage5 │ │ │ ├── main.js │ │ │ └── tests.py │ └── zookeeper │ │ ├── stage1 │ │ ├── main.js │ │ └── tests.py │ │ ├── stage2 │ │ ├── main.js │ │ └── tests.py │ │ ├── stage3 │ │ ├── main.js │ │ └── tests.py │ │ └── stage4 │ │ ├── main.js │ │ └── tests.py ├── python │ └── coffee_machine │ │ ├── stage1 │ │ ├── machine │ │ │ └── coffee_machine.py │ │ └── tests.py │ │ ├── stage2 │ │ ├── machine │ │ │ └── coffee_machine.py │ │ └── tests.py │ │ ├── stage3 │ │ ├── machine │ │ │ └── coffee_machine.py │ │ └── tests.py │ │ ├── stage4 │ │ ├── machine │ │ │ └── coffee_machine.py │ │ └── tests.py │ │ └── stage5 │ │ ├── machine │ │ └── coffee_machine.py │ │ └── tests.py └── shell │ └── coffee_machine │ ├── stage1 │ ├── main.sh │ └── tests.py │ ├── stage1_ex │ ├── main.sh │ └── tests.py │ ├── stage1_wa │ ├── main.sh │ └── tests.py │ └── stage2 │ ├── main.sh │ └── tests.py ├── sql ├── test_db_connection │ └── sqlite │ │ ├── main.sql │ │ └── test.py ├── test_parsing_sql_files │ └── parsing1 │ │ ├── main.sql │ │ └── test.py └── test_queries │ ├── execute │ ├── test_execute_query_name_with_wrong_query │ │ ├── main.sql │ │ └── test.py │ ├── test_execute_with_plain_query │ │ ├── main.sql │ │ └── test.py │ ├── test_execute_with_query_name │ │ ├── main.sql │ │ └── test.py │ └── test_execute_with_wrong_plain_query │ │ ├── main.sql │ │ └── test.py │ └── sqlite │ ├── create_table │ ├── main.sql │ └── test.py │ ├── insert_and_select_data │ ├── main.sql │ └── test.py │ └── test_parsing_empty_query │ ├── main.sql │ └── test.py ├── test_check_result.py ├── test_testcase.py └── testing.py /.gitattributes: -------------------------------------------------------------------------------- 1 | *.yml text eol=lf 2 | *.yaml text eol=lf 3 | *.py text eol=lf 4 | *.toml text eol=lf 5 | *.md text eol=lf 6 | *.txt text eol=lf 7 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Task: [#HSPC-](https://vyahhi.myjetbrains.com/youtrack/issue/HSPC-) 2 | 3 | **Reviewers** 4 | - [ ] @ 5 | 6 | **Description** 7 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "github-actions" 4 | directory: "/" 5 | schedule: 6 | interval: "weekly" 7 | day: "monday" 8 | time: "00:00" 9 | groups: 10 | all-actions: 11 | patterns: [ "*" ] 12 | 13 | - package-ecosystem: "pip" 14 | directory: "/" 15 | schedule: 16 | interval: "daily" 17 | time: "00:00" 18 | -------------------------------------------------------------------------------- /.github/workflows/auto-author-assign.yml: -------------------------------------------------------------------------------- 1 | name: Auto Author Assign 2 | 3 | on: 4 | pull_request_target: 5 | types: [ opened, reopened ] 6 | 7 | permissions: 8 | pull-requests: write 9 | 10 | jobs: 11 | assign-author: 12 | runs-on: arc-runners-small 13 | timeout-minutes: 30 14 | if: ${{ !github.event.pull_request.assignee }} 15 | steps: 16 | - uses: toshimaru/auto-author-assign@v2.1.0 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | **__pycache__** 2 | .idea 3 | venv* 4 | build/ 5 | /hs_test_python.egg-info/ 6 | node_modules 7 | package-lock.json 8 | -------------------------------------------------------------------------------- /.go-version: -------------------------------------------------------------------------------- 1 | 1.21 -------------------------------------------------------------------------------- /.node-version: -------------------------------------------------------------------------------- 1 | 20 -------------------------------------------------------------------------------- /.poetry-version: -------------------------------------------------------------------------------- 1 | 2.0.1 -------------------------------------------------------------------------------- /.python-version: -------------------------------------------------------------------------------- 1 | 3.10.13 -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.6-alpine3.15 2 | 3 | RUN apk add --no-cache \ 4 | bash \ 5 | g++ \ 6 | gcc \ 7 | linux-headers 8 | 9 | RUN pip install --no-cache-dir \ 10 | matplotlib \ 11 | seaborn \ 12 | pandas \ 13 | numpy 14 | 15 | COPY . hs-test-python 16 | RUN pip3 install --no-cache-dir ./hs-test-python 17 | 18 | WORKDIR /hs-test-python 19 | ENV PYTHONPATH=. 20 | 21 | CMD ["bash"] 22 | -------------------------------------------------------------------------------- /hstest/check_result.py: -------------------------------------------------------------------------------- 1 | # deprecated, but old tests use "from hstest.check_result import CheckResult" 2 | # new way to import is "from hstest import CheckResult" 3 | from __future__ import annotations 4 | 5 | from hstest.test_case import CheckResult, correct, wrong # noqa: F401 6 | -------------------------------------------------------------------------------- /hstest/common/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperskill/hs-test-python/0339e9ac29cce939d994b8c4ed85a6daa41d4306/hstest/common/__init__.py -------------------------------------------------------------------------------- /hstest/common/os_utils.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import platform 4 | 5 | 6 | def is_windows(): 7 | return platform.system() == "Windows" 8 | 9 | 10 | def is_mac(): 11 | return platform.system() == "Darwin" 12 | 13 | 14 | def is_linux(): 15 | return platform.system() == "Linux" 16 | -------------------------------------------------------------------------------- /hstest/dynamic/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperskill/hs-test-python/0339e9ac29cce939d994b8c4ed85a6daa41d4306/hstest/dynamic/__init__.py -------------------------------------------------------------------------------- /hstest/dynamic/input/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperskill/hs-test-python/0339e9ac29cce939d994b8c4ed85a6daa41d4306/hstest/dynamic/input/__init__.py -------------------------------------------------------------------------------- /hstest/dynamic/output/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperskill/hs-test-python/0339e9ac29cce939d994b8c4ed85a6daa41d4306/hstest/dynamic/output/__init__.py -------------------------------------------------------------------------------- /hstest/dynamic/security/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperskill/hs-test-python/0339e9ac29cce939d994b8c4ed85a6daa41d4306/hstest/dynamic/security/__init__.py -------------------------------------------------------------------------------- /hstest/dynamic/security/exit_exception.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from typing import NoReturn 4 | 5 | 6 | class ExitException(BaseException): 7 | @staticmethod 8 | def throw() -> NoReturn: 9 | raise ExitException 10 | -------------------------------------------------------------------------------- /hstest/exception/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperskill/hs-test-python/0339e9ac29cce939d994b8c4ed85a6daa41d4306/hstest/exception/__init__.py -------------------------------------------------------------------------------- /hstest/exceptions.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from hstest.exception.outcomes import TestPassed, WrongAnswer 4 | 5 | # deprecated, but have to be sure old tests work as expected 6 | TestPassedException = TestPassed 7 | WrongAnswerException = WrongAnswer 8 | -------------------------------------------------------------------------------- /hstest/outcomes/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperskill/hs-test-python/0339e9ac29cce939d994b8c4ed85a6daa41d4306/hstest/outcomes/__init__.py -------------------------------------------------------------------------------- /hstest/outcomes/compilation_error_outcome.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from typing import TYPE_CHECKING 4 | 5 | from hstest.outcomes.outcome import Outcome 6 | 7 | if TYPE_CHECKING: 8 | from hstest.exception.outcomes import CompilationError 9 | 10 | 11 | class CompilationErrorOutcome(Outcome): 12 | def __init__(self, ex: CompilationError) -> None: 13 | super().__init__() 14 | self.test_number = -1 15 | self.error_text = ex.error_text 16 | 17 | def get_type(self) -> str: 18 | return "Compilation error" 19 | -------------------------------------------------------------------------------- /hstest/outcomes/wrong_answer_outcome.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from typing import TYPE_CHECKING 4 | 5 | from hstest.outcomes.outcome import Outcome 6 | 7 | if TYPE_CHECKING: 8 | from hstest.exception.outcomes import WrongAnswer 9 | 10 | 11 | class WrongAnswerOutcome(Outcome): 12 | def __init__(self, test_num: int, ex: WrongAnswer) -> None: 13 | super().__init__(test_num, ex.feedback, "") 14 | 15 | def get_type(self) -> str: 16 | return "Wrong answer" 17 | -------------------------------------------------------------------------------- /hstest/stage_test.py: -------------------------------------------------------------------------------- 1 | # deprecated, but old tests use "from hstest.stage_test import StageTest" 2 | # new way to import is "from hstest import StageTest" 3 | from __future__ import annotations 4 | 5 | from hstest.stage.stage_test import * # noqa: F403 6 | -------------------------------------------------------------------------------- /hstest/test_case/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | __all__ = [ 4 | "CheckResult", 5 | "SimpleTestCase", 6 | "TestCase", 7 | "correct", 8 | "wrong", 9 | ] 10 | 11 | from hstest.test_case.check_result import CheckResult, correct, wrong 12 | from hstest.test_case.test_case import SimpleTestCase, TestCase 13 | -------------------------------------------------------------------------------- /hstest/test_case/attach/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperskill/hs-test-python/0339e9ac29cce939d994b8c4ed85a6daa41d4306/hstest/test_case/attach/__init__.py -------------------------------------------------------------------------------- /hstest/test_case/attach/django_settings.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | 4 | class DjangoSettings: 5 | port: int = None 6 | use_database: bool = False 7 | test_database: str = "db.test.sqlite3" 8 | tryout_ports: list[int] = list(range(8000, 8101)) 9 | -------------------------------------------------------------------------------- /hstest/test_case/attach/flask_settings.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | 4 | class FlaskSettings: 5 | sources: list[tuple[str, int]] = [] 6 | tryout_ports: list[int] = list(range(8000, 8101)) 7 | -------------------------------------------------------------------------------- /hstest/testing/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperskill/hs-test-python/0339e9ac29cce939d994b8c4ed85a6daa41d4306/hstest/testing/__init__.py -------------------------------------------------------------------------------- /hstest/testing/execution/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperskill/hs-test-python/0339e9ac29cce939d994b8c4ed85a6daa41d4306/hstest/testing/execution/__init__.py -------------------------------------------------------------------------------- /hstest/testing/execution/filtering/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperskill/hs-test-python/0339e9ac29cce939d994b8c4ed85a6daa41d4306/hstest/testing/execution/filtering/__init__.py -------------------------------------------------------------------------------- /hstest/testing/execution/process/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperskill/hs-test-python/0339e9ac29cce939d994b8c4ed85a6daa41d4306/hstest/testing/execution/process/__init__.py -------------------------------------------------------------------------------- /hstest/testing/execution/process/javascript_executor.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from hstest.testing.execution.process_executor import ProcessExecutor 4 | from hstest.testing.execution.searcher.javascript_searcher import JavascriptSearcher 5 | 6 | 7 | class JavascriptExecutor(ProcessExecutor): 8 | def __init__(self, source_name: str | None = None) -> None: 9 | super().__init__(JavascriptSearcher().find(source_name)) 10 | 11 | def _execution_command(self, *args: str): 12 | return ["node", self.runnable.file, *list(args)] 13 | -------------------------------------------------------------------------------- /hstest/testing/execution/process/shell_executor.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from hstest.testing.execution.process_executor import ProcessExecutor 4 | from hstest.testing.execution.searcher.shell_searcher import ShellSearcher 5 | 6 | 7 | class ShellExecutor(ProcessExecutor): 8 | def __init__(self, source_name: str | None = None) -> None: 9 | super().__init__(ShellSearcher().find(source_name)) 10 | 11 | def _execution_command(self, *args: str): 12 | return ["bash", self.runnable.file, *list(args)] 13 | -------------------------------------------------------------------------------- /hstest/testing/execution/runnable/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperskill/hs-test-python/0339e9ac29cce939d994b8c4ed85a6daa41d4306/hstest/testing/execution/runnable/__init__.py -------------------------------------------------------------------------------- /hstest/testing/execution/runnable/python_runnable_file.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from hstest.testing.execution.runnable.runnable_file import RunnableFile 4 | 5 | 6 | class PythonRunnableFile(RunnableFile): 7 | def __init__(self, folder: str, file: str, module: str) -> None: 8 | super().__init__(folder, file) 9 | self.module = module 10 | -------------------------------------------------------------------------------- /hstest/testing/execution/runnable/runnable_file.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from typing import TYPE_CHECKING 4 | 5 | if TYPE_CHECKING: 6 | from hstest.testing.execution.filtering.file_filter import File, Folder 7 | 8 | 9 | class RunnableFile: 10 | def __init__(self, folder: Folder, file: File) -> None: 11 | self.folder = folder 12 | self.file = file 13 | -------------------------------------------------------------------------------- /hstest/testing/execution/searcher/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperskill/hs-test-python/0339e9ac29cce939d994b8c4ed85a6daa41d4306/hstest/testing/execution/searcher/__init__.py -------------------------------------------------------------------------------- /hstest/testing/execution/searcher/sql_searcher.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from typing import TYPE_CHECKING 4 | 5 | from hstest.testing.execution.searcher.base_searcher import BaseSearcher 6 | 7 | if TYPE_CHECKING: 8 | from hstest.testing.execution.runnable.runnable_file import RunnableFile 9 | 10 | 11 | class SQLSearcher(BaseSearcher): 12 | @property 13 | def extension(self) -> str: 14 | return ".sql" 15 | 16 | def search(self, where: str | None = None) -> RunnableFile: 17 | return self._base_search(where) 18 | -------------------------------------------------------------------------------- /hstest/testing/execution_options.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import os 4 | import sys 5 | 6 | skip_slow: bool = "--skip_slow" in sys.argv 7 | ignore_stdout: bool = "--ignore_stdout" in sys.argv 8 | inside_docker: bool = "--inside_docker" in sys.argv or os.environ.get("INSIDE_DOCKER", "") == "1" 9 | debug_mode: bool = "--debug_mode" in sys.argv or sys.gettrace() is not None 10 | force_process_testing: bool = "--force_process_testing" in sys.argv 11 | -------------------------------------------------------------------------------- /hstest/testing/plotting/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperskill/hs-test-python/0339e9ac29cce939d994b8c4ed85a6daa41d4306/hstest/testing/plotting/__init__.py -------------------------------------------------------------------------------- /hstest/testing/plotting/drawing/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperskill/hs-test-python/0339e9ac29cce939d994b8c4ed85a6daa41d4306/hstest/testing/plotting/drawing/__init__.py -------------------------------------------------------------------------------- /hstest/testing/plotting/drawing/drawing.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from typing import Any, TYPE_CHECKING 4 | 5 | if TYPE_CHECKING: 6 | from hstest.testing.plotting.drawing.drawing_data import DrawingData 7 | 8 | 9 | class Drawing: 10 | def __init__( 11 | self, library: str, plot_type: str, data: DrawingData | None, kwargs: dict[str, Any] 12 | ) -> None: 13 | self.library: str = library 14 | self.type: str = plot_type 15 | self.data: DrawingData | None = data 16 | self.kwargs: dict[str, Any] = kwargs 17 | -------------------------------------------------------------------------------- /hstest/testing/plotting/drawing/drawing_library.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | 4 | class DrawingLibrary: 5 | matplotlib = "matplotlib" 6 | pandas = "pandas" 7 | seaborn = "seaborn" 8 | -------------------------------------------------------------------------------- /hstest/testing/runner/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperskill/hs-test-python/0339e9ac29cce939d994b8c4ed85a6daa41d4306/hstest/testing/runner/__init__.py -------------------------------------------------------------------------------- /hstest/testing/settings.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | 4 | class Settings: 5 | do_reset_output: bool = True 6 | allow_out_of_input: bool = False 7 | catch_stderr: bool = True 8 | 9 | def __init__(self) -> None: 10 | msg = "Instances of the class Settings are prohibited" 11 | raise NotImplementedError(msg) 12 | -------------------------------------------------------------------------------- /hstest/testing/unittest/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperskill/hs-test-python/0339e9ac29cce939d994b8c4ed85a6daa41d4306/hstest/testing/unittest/__init__.py -------------------------------------------------------------------------------- /hstest/testing/unittest/unexepected_error_test.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from hstest.testing.unittest.expected_fail_test import ExpectedFailTest 4 | 5 | 6 | class UnexpectedErrorTest(ExpectedFailTest): 7 | _base_contain = "Unexpected error" 8 | -------------------------------------------------------------------------------- /hstest/testing/unittest/user_error_test.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from hstest.testing.unittest.expected_fail_test import ExpectedFailTest 4 | 5 | 6 | class UserErrorTest(ExpectedFailTest): 7 | _base_not_contain = "Unexpected error" 8 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test-sync-input", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "sync-input": "github:hyperskill/sync-input" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | psutil==7.0.0 2 | mypy==1.13.0 3 | pandas==2.2.3 4 | ruff==0.7.3 5 | matplotlib==3.9.2 6 | seaborn==0.13.2 7 | scipy==1.15.3 -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperskill/hs-test-python/0339e9ac29cce939d994b8c4ed85a6daa41d4306/tests/__init__.py -------------------------------------------------------------------------------- /tests/outcomes/command_line_args/test_command_line_args_changed/main.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | sys.argv[0] = None 4 | -------------------------------------------------------------------------------- /tests/outcomes/command_line_args/test_command_line_arguments_failed/main.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | print(len(sys.argv) - 1) 4 | for arg in sys.argv[1:]: 5 | print(arg) 6 | -------------------------------------------------------------------------------- /tests/outcomes/command_line_args/test_command_line_arguments_failed_2/main.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperskill/hs-test-python/0339e9ac29cce939d994b8c4ed85a6daa41d4306/tests/outcomes/command_line_args/test_command_line_arguments_failed_2/main.py -------------------------------------------------------------------------------- /tests/outcomes/command_line_args/test_command_line_arguments_failed_dynamic_method/main.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | print(len(sys.argv) - 1) 4 | for arg in sys.argv[1:]: 5 | print(arg) 6 | -------------------------------------------------------------------------------- /tests/outcomes/command_line_args/test_command_line_arguments_failed_dynamic_method_2/main.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperskill/hs-test-python/0339e9ac29cce939d994b8c4ed85a6daa41d4306/tests/outcomes/command_line_args/test_command_line_arguments_failed_dynamic_method_2/main.py -------------------------------------------------------------------------------- /tests/outcomes/command_line_args/test_command_line_arguments_failed_dynamic_method_3/main.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | print(len(sys.argv) - 1) 4 | for arg in sys.argv[1:]: 5 | print(arg) 6 | -------------------------------------------------------------------------------- /tests/outcomes/command_line_args/test_command_line_arguments_failed_dynamic_method_3/main2.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperskill/hs-test-python/0339e9ac29cce939d994b8c4ed85a6daa41d4306/tests/outcomes/command_line_args/test_command_line_arguments_failed_dynamic_method_3/main2.py -------------------------------------------------------------------------------- /tests/outcomes/command_line_args/test_command_line_arguments_failed_dynamic_method_4/main.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | print(len(sys.argv) - 1) 4 | for arg in sys.argv[1:]: 5 | print(arg) 6 | -------------------------------------------------------------------------------- /tests/outcomes/command_line_args/test_command_line_arguments_failed_dynamic_method_4/main2.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperskill/hs-test-python/0339e9ac29cce939d994b8c4ed85a6daa41d4306/tests/outcomes/command_line_args/test_command_line_arguments_failed_dynamic_method_4/main2.py -------------------------------------------------------------------------------- /tests/outcomes/command_line_args/test_command_line_arguments_failed_dynamic_method_5/main.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | print(len(sys.argv) - 1) 4 | for arg in sys.argv[1:]: 5 | print(arg) 6 | -------------------------------------------------------------------------------- /tests/outcomes/command_line_args/test_command_line_arguments_failed_dynamic_method_5/main2.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperskill/hs-test-python/0339e9ac29cce939d994b8c4ed85a6daa41d4306/tests/outcomes/command_line_args/test_command_line_arguments_failed_dynamic_method_5/main2.py -------------------------------------------------------------------------------- /tests/outcomes/command_line_args/test_command_line_arguments_failed_dynamic_testing/main.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | print(len(sys.argv) - 1) 4 | for arg in sys.argv[1:]: 5 | print(arg) 6 | -------------------------------------------------------------------------------- /tests/outcomes/command_line_args/test_command_line_arguments_failed_dynamic_testing_2/main.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperskill/hs-test-python/0339e9ac29cce939d994b8c4ed85a6daa41d4306/tests/outcomes/command_line_args/test_command_line_arguments_failed_dynamic_testing_2/main.py -------------------------------------------------------------------------------- /tests/outcomes/command_line_args/test_command_line_arguments_failed_dynamic_testing_3/main.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | print(len(sys.argv) - 1) 4 | for arg in sys.argv[1:]: 5 | print(arg) 6 | -------------------------------------------------------------------------------- /tests/outcomes/command_line_args/test_command_line_arguments_failed_dynamic_testing_3/main2.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperskill/hs-test-python/0339e9ac29cce939d994b8c4ed85a6daa41d4306/tests/outcomes/command_line_args/test_command_line_arguments_failed_dynamic_testing_3/main2.py -------------------------------------------------------------------------------- /tests/outcomes/command_line_args/test_command_line_arguments_failed_dynamic_testing_4/main.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | print(len(sys.argv) - 1) 4 | for arg in sys.argv[1:]: 5 | print(arg) 6 | -------------------------------------------------------------------------------- /tests/outcomes/command_line_args/test_command_line_arguments_failed_dynamic_testing_4/main2.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperskill/hs-test-python/0339e9ac29cce939d994b8c4ed85a6daa41d4306/tests/outcomes/command_line_args/test_command_line_arguments_failed_dynamic_testing_4/main2.py -------------------------------------------------------------------------------- /tests/outcomes/command_line_args/test_command_line_arguments_failed_dynamic_testing_5/main.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | print(len(sys.argv) - 1) 4 | for arg in sys.argv[1:]: 5 | print(arg) 6 | -------------------------------------------------------------------------------- /tests/outcomes/command_line_args/test_command_line_arguments_failed_dynamic_testing_5/main2.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperskill/hs-test-python/0339e9ac29cce939d994b8c4ed85a6daa41d4306/tests/outcomes/command_line_args/test_command_line_arguments_failed_dynamic_testing_5/main2.py -------------------------------------------------------------------------------- /tests/outcomes/command_line_args/test_command_line_arguments_failed_second_test/main.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperskill/hs-test-python/0339e9ac29cce939d994b8c4ed85a6daa41d4306/tests/outcomes/command_line_args/test_command_line_arguments_failed_second_test/main.py -------------------------------------------------------------------------------- /tests/outcomes/command_line_args/test_command_line_arguments_failed_second_test_dynamic_method/main.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | print(len(sys.argv) - 1) 4 | for arg in sys.argv[1:]: 5 | print(arg) 6 | -------------------------------------------------------------------------------- /tests/outcomes/command_line_args/test_command_line_arguments_failed_second_test_dynamic_method/main2.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperskill/hs-test-python/0339e9ac29cce939d994b8c4ed85a6daa41d4306/tests/outcomes/command_line_args/test_command_line_arguments_failed_second_test_dynamic_method/main2.py -------------------------------------------------------------------------------- /tests/outcomes/command_line_args/test_command_line_arguments_failed_second_test_dynamic_testing/main.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | print(len(sys.argv) - 1) 4 | for arg in sys.argv[1:]: 5 | print(arg) 6 | -------------------------------------------------------------------------------- /tests/outcomes/command_line_args/test_command_line_arguments_failed_second_test_dynamic_testing/main2.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperskill/hs-test-python/0339e9ac29cce939d994b8c4ed85a6daa41d4306/tests/outcomes/command_line_args/test_command_line_arguments_failed_second_test_dynamic_testing/main2.py -------------------------------------------------------------------------------- /tests/outcomes/command_line_args/test_command_line_arguments_failed_with_spaces/main.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | print(len(sys.argv) - 1) 4 | for arg in sys.argv[1:]: 5 | print(arg) 6 | -------------------------------------------------------------------------------- /tests/outcomes/command_line_args/test_command_line_arguments_passing/main.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | print(len(sys.argv[1:])) 4 | print(*sys.argv[1:], sep='\n') 5 | -------------------------------------------------------------------------------- /tests/outcomes/command_line_args/test_command_line_arguments_passing_dynamic_method/main.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | print(len(sys.argv) - 1) 4 | for arg in sys.argv[1:]: 5 | print(arg) 6 | -------------------------------------------------------------------------------- /tests/outcomes/command_line_args/test_command_line_arguments_passing_dynamic_testing/main.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | print(len(sys.argv) - 1) 4 | for arg in sys.argv[1:]: 5 | print(arg) 6 | -------------------------------------------------------------------------------- /tests/outcomes/dynamic_input/success_dynamic_input/main.py: -------------------------------------------------------------------------------- 1 | print('Hello') 2 | line = input() 3 | if line == '1': 4 | print(input()) 5 | else: 6 | print(line) 7 | -------------------------------------------------------------------------------- /tests/outcomes/dynamic_input/test_dynamic_input/main.py: -------------------------------------------------------------------------------- 1 | print(input() + '0000') 2 | print(input() + '1111') 3 | print(input() + '2222') 4 | -------------------------------------------------------------------------------- /tests/outcomes/dynamic_input/test_dynamic_input_fail_infinite_loop/main.py: -------------------------------------------------------------------------------- 1 | while True: 2 | print(input()) 3 | -------------------------------------------------------------------------------- /tests/outcomes/dynamic_input/test_dynamic_input_fail_infinite_loop/test.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | 3 | from hstest.check_result import wrong 4 | from hstest.test_case import TestCase 5 | from hstest.testing.unittest.user_error_test import UserErrorTest 6 | 7 | 8 | class TestDynamicInputFailInfiniteLoop(UserErrorTest): 9 | contain = """ 10 | Wrong answer in test #1 11 | 12 | Wrong 13 | """ 14 | 15 | def generate(self) -> List[TestCase]: 16 | return [ 17 | TestCase(stdin=[lambda x: wrong("Wrong")]) 18 | ] 19 | -------------------------------------------------------------------------------- /tests/outcomes/dynamic_input/test_dynamic_input_fail_infinite_loop_2/main.py: -------------------------------------------------------------------------------- 1 | while True: 2 | try: 3 | print(input()) 4 | except Exception: 5 | pass 6 | -------------------------------------------------------------------------------- /tests/outcomes/dynamic_input/test_dynamic_input_fail_infinite_loop_2/test.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | 3 | from hstest.check_result import wrong 4 | from hstest.test_case import TestCase 5 | from hstest.testing.unittest.user_error_test import UserErrorTest 6 | 7 | 8 | class TestDynamicInputFailInfiniteLoop(UserErrorTest): 9 | contain = """ 10 | Wrong answer in test #1 11 | 12 | Wrong 13 | """ 14 | 15 | def generate(self) -> List[TestCase]: 16 | return [ 17 | TestCase(stdin=[lambda x: wrong("Wrong")]) 18 | ] 19 | -------------------------------------------------------------------------------- /tests/outcomes/dynamic_input/test_multiple_dynamic_inputs/main.py: -------------------------------------------------------------------------------- 1 | for i in range(5): 2 | print(input()) 3 | -------------------------------------------------------------------------------- /tests/outcomes/dynamic_method/test_dont_return_output_after_execution/main.py: -------------------------------------------------------------------------------- 1 | print("Initial text") 2 | input() 3 | 4 | print("1 to 2") 5 | input() 6 | 7 | print("2 to 3") 8 | input() 9 | 10 | print("3 to 4") 11 | input() 12 | -------------------------------------------------------------------------------- /tests/outcomes/dynamic_method/test_dynamic_method_accepted_simple/main.py: -------------------------------------------------------------------------------- 1 | print("Program started!") 2 | print("S1: " + input()) 3 | print("S2: " + input()) 4 | -------------------------------------------------------------------------------- /tests/outcomes/dynamic_method/test_dynamic_method_early_exit/main.py: -------------------------------------------------------------------------------- 1 | print("Server started!") 2 | print("S1: " + input()) 3 | -------------------------------------------------------------------------------- /tests/outcomes/dynamic_method/test_dynamic_method_exception/main.py: -------------------------------------------------------------------------------- 1 | print("Server started!") 2 | print("S1: " + input()) 3 | print(0/0) 4 | print("S2: " + input()) 5 | -------------------------------------------------------------------------------- /tests/outcomes/dynamic_method/test_dynamic_method_program_not_finished_after_test/main.py: -------------------------------------------------------------------------------- 1 | print("Server started!") 2 | print("S1: " + input()) 3 | print("S2: " + input()) 4 | -------------------------------------------------------------------------------- /tests/outcomes/dynamic_method/test_dynamic_method_program_not_finished_after_test_but_exception_happened/main.py: -------------------------------------------------------------------------------- 1 | print("Server started!") 2 | print("S1: " + input()) 3 | print("S2: " + input()) 4 | -------------------------------------------------------------------------------- /tests/outcomes/dynamic_method/test_dynamic_method_program_not_finished_after_test_but_shut_down_module/main.py: -------------------------------------------------------------------------------- 1 | try: 2 | print("Server started!") 3 | print("S1: " + input()) 4 | print("S2: " + input()) 5 | except BaseException: 6 | print("Server stopped!") 7 | -------------------------------------------------------------------------------- /tests/outcomes/dynamic_method/test_dynamic_method_program_not_finished_after_test_but_shut_down_process/main.py: -------------------------------------------------------------------------------- 1 | try: 2 | print("Server started!") 3 | print("S1: " + input()) 4 | print("S2: " + input()) 5 | except BaseException: 6 | print("Server stopped!") 7 | -------------------------------------------------------------------------------- /tests/outcomes/dynamic_method/test_dynamic_method_start_in_background_correct/main.py: -------------------------------------------------------------------------------- 1 | from time import sleep 2 | 3 | print("Server started!") 4 | sleep(0.5) 5 | print("S1") 6 | -------------------------------------------------------------------------------- /tests/outcomes/dynamic_method/test_dynamic_method_start_in_background_wrong_answer/main.py: -------------------------------------------------------------------------------- 1 | from time import sleep 2 | 3 | print("Server started!") 4 | sleep(0.1) 5 | print("S1") 6 | sleep(0.1) 7 | print("S2") 8 | sleep(0.1) 9 | print("S3") 10 | sleep(100) 11 | print("S4") 12 | -------------------------------------------------------------------------------- /tests/outcomes/dynamic_method/test_dynamic_method_unexpected_error_no_check_method/main.py: -------------------------------------------------------------------------------- 1 | print("Server started!") 2 | print("S1: " + input()) 3 | print("S2: " + input()) 4 | -------------------------------------------------------------------------------- /tests/outcomes/dynamic_method/test_dynamic_method_wrong_answer_in_check_method/main.py: -------------------------------------------------------------------------------- 1 | print("Server started!") 2 | print("S1: " + input()) 3 | print("S2: " + input()) 4 | -------------------------------------------------------------------------------- /tests/outcomes/dynamic_method/test_feedback/test.py: -------------------------------------------------------------------------------- 1 | from hstest.check_result import CheckResult 2 | from hstest.dynamic.dynamic_test import dynamic_test 3 | from hstest.testing.unittest.user_error_test import UserErrorTest 4 | 5 | 6 | class TestFeedback(UserErrorTest): 7 | contain = """ 8 | Wrong answer in test #1 9 | 10 | feedback 2 11 | 12 | feedback 1 13 | """ # noqa: W293 14 | 15 | @dynamic_test(feedback="feedback 1") 16 | def test(self): 17 | return CheckResult.wrong("feedback 2") 18 | -------------------------------------------------------------------------------- /tests/outcomes/dynamic_method/test_files/test.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from hstest.check_result import correct, wrong 4 | from hstest.dynamic.dynamic_test import dynamic_test 5 | from hstest.stage_test import StageTest 6 | 7 | 8 | class TestFilesInDynamicTest(StageTest): 9 | @dynamic_test(files={'123.txt': '12345'}) 10 | def test(self): 11 | if '123.txt' in os.listdir('.'): 12 | if open('123.txt').read() == '12345': 13 | return correct() 14 | 15 | return wrong('There should be a file named "123.txt" with content "12345"') 16 | -------------------------------------------------------------------------------- /tests/outcomes/dynamic_method/test_getting_output_while_program_in_background/main.py: -------------------------------------------------------------------------------- 1 | from time import sleep 2 | 3 | while True: 4 | sleep(0.1) 5 | print("Test") 6 | -------------------------------------------------------------------------------- /tests/outcomes/dynamic_output/test_dynamic_output/main.py: -------------------------------------------------------------------------------- 1 | print('1') 2 | print('2') 3 | line_3 = input() 4 | if line_3 != '3': 5 | 0/0 6 | print('5') 7 | line_4 = input() 8 | if line_4 != '4': 9 | 0/0 10 | print('6') 11 | line_7 = input() 12 | if line_7 != '7': 13 | 0/0 14 | line_8 = input() 15 | if line_8 != '8': 16 | 0/0 17 | -------------------------------------------------------------------------------- /tests/outcomes/dynamic_output/test_dynamic_output_with_input/main.py: -------------------------------------------------------------------------------- 1 | input('Print x and y: ') 2 | int(input()) 3 | print('Another num:') 4 | int(input()) 5 | -------------------------------------------------------------------------------- /tests/outcomes/dynamic_output/test_dynamic_output_without_input/main.py: -------------------------------------------------------------------------------- 1 | print('Print x and y: ', end='') 2 | print('123 456') 3 | print('Another num:') 4 | -------------------------------------------------------------------------------- /tests/outcomes/feedback_on_exception/feedback_on_exception_test_1/main.py: -------------------------------------------------------------------------------- 1 | print('Hello World') 2 | print(1 / 0) 3 | -------------------------------------------------------------------------------- /tests/outcomes/feedback_on_exception/feedback_on_exception_test_2/main.py: -------------------------------------------------------------------------------- 1 | raise AttributeError() 2 | -------------------------------------------------------------------------------- /tests/outcomes/feedback_on_exception/feedback_on_exception_test_3/main.py: -------------------------------------------------------------------------------- 1 | raise Exception() 2 | -------------------------------------------------------------------------------- /tests/outcomes/feedback_on_exception/feedback_on_exception_test_4/main.py: -------------------------------------------------------------------------------- 1 | raise Exception() 2 | -------------------------------------------------------------------------------- /tests/outcomes/feedback_on_exception/feedback_on_exception_test_5_module/main.py: -------------------------------------------------------------------------------- 1 | raise ZeroDivisionError() 2 | -------------------------------------------------------------------------------- /tests/outcomes/feedback_on_exception/feedback_on_exception_test_5_process/main.py: -------------------------------------------------------------------------------- 1 | raise ZeroDivisionError() 2 | -------------------------------------------------------------------------------- /tests/outcomes/imports/not_fallback_on_not_found_executabe_file/dir1/main.py: -------------------------------------------------------------------------------- 1 | print('Hello!') 2 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_absolute/random_module/main.py: -------------------------------------------------------------------------------- 1 | from main2 import x 2 | print(x) 3 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_absolute/random_module/main2.py: -------------------------------------------------------------------------------- 1 | x = 101 2 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_absolute/test.py: -------------------------------------------------------------------------------- 1 | from typing import Any, List 2 | 3 | from hstest.check_result import CheckResult 4 | from hstest.stage_test import StageTest 5 | from hstest.test_case import TestCase 6 | 7 | 8 | class TestImportAbsolute(StageTest): 9 | source = 'random_module.main' 10 | 11 | def generate(self) -> List[TestCase]: 12 | return [TestCase()] 13 | 14 | def check(self, reply: str, attach: Any) -> CheckResult: 15 | return CheckResult(reply == '101\n', '') 16 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_absolute_2/random_module/main.py: -------------------------------------------------------------------------------- 1 | import main2 2 | print(main2.x) 3 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_absolute_2/random_module/main2.py: -------------------------------------------------------------------------------- 1 | x = 102 2 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_absolute_2/test.py: -------------------------------------------------------------------------------- 1 | from typing import Any, List 2 | 3 | from hstest.check_result import CheckResult 4 | from hstest.stage_test import StageTest 5 | from hstest.test_case import TestCase 6 | 7 | 8 | class TestImportAbsolute2(StageTest): 9 | source = 'random_module.main' 10 | 11 | def generate(self) -> List[TestCase]: 12 | return [TestCase()] 13 | 14 | def check(self, reply: str, attach: Any) -> CheckResult: 15 | return CheckResult(reply == '102\n', '') 16 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_absolute_error/main.py: -------------------------------------------------------------------------------- 1 | from main2 import x 2 | print(x) 3 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_absolute_error/main2.py: -------------------------------------------------------------------------------- 1 | x = 103 2 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_absolute_error/test.py: -------------------------------------------------------------------------------- 1 | from typing import Any, List 2 | 3 | from hstest.check_result import CheckResult 4 | from hstest.stage_test import StageTest 5 | from hstest.test_case import TestCase 6 | 7 | 8 | class TestImportAbsoluteError(StageTest): 9 | 10 | def generate(self) -> List[TestCase]: 11 | return [TestCase()] 12 | 13 | def check(self, reply: str, attach: Any) -> CheckResult: 14 | return CheckResult(reply == '103\n', '') 15 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_absolute_error_2/main.py: -------------------------------------------------------------------------------- 1 | import main2 2 | print(main2.x) 3 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_absolute_error_2/main2.py: -------------------------------------------------------------------------------- 1 | x = 104 2 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_absolute_error_2/test.py: -------------------------------------------------------------------------------- 1 | from typing import Any, List 2 | 3 | from hstest.check_result import CheckResult 4 | from hstest.stage_test import StageTest 5 | from hstest.test_case import TestCase 6 | 7 | 8 | class TestImportAbsoluteError2(StageTest): 9 | 10 | def generate(self) -> List[TestCase]: 11 | return [TestCase()] 12 | 13 | def check(self, reply: str, attach: Any) -> CheckResult: 14 | return CheckResult(reply == '104\n', '') 15 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_absolute_error_circular/main.py: -------------------------------------------------------------------------------- 1 | import main2 2 | print(main2.x) 3 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_absolute_error_circular/main2.py: -------------------------------------------------------------------------------- 1 | import main 2 | x = 1040 3 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_absolute_error_circular_2/main.py: -------------------------------------------------------------------------------- 1 | import main2 2 | print(main2.x) 3 | 4 | if __name__ == '__main__': 5 | print() 6 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_absolute_error_circular_2/main2.py: -------------------------------------------------------------------------------- 1 | import main 2 | x = 105 3 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_absolute_error_circular_3/main.py: -------------------------------------------------------------------------------- 1 | import main2 2 | 3 | if __name__ == '__main__': 4 | print(main2.x) 5 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_absolute_error_circular_3/main2.py: -------------------------------------------------------------------------------- 1 | import main 2 | x = 106 3 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_absolute_error_circular_3/test.py: -------------------------------------------------------------------------------- 1 | from typing import Any, List 2 | 3 | from hstest.check_result import CheckResult 4 | from hstest.stage_test import StageTest 5 | from hstest.test_case import TestCase 6 | 7 | 8 | class TestImportAbsoluteErrorCircular3(StageTest): 9 | 10 | def generate(self) -> List[TestCase]: 11 | return [TestCase()] 12 | 13 | def check(self, reply: str, attach: Any) -> CheckResult: 14 | return CheckResult(reply == '106\n', '') 15 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_absolute_error_circular_4/main.py: -------------------------------------------------------------------------------- 1 | import main2 2 | print(main2.x) 3 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_absolute_error_circular_4/main2.py: -------------------------------------------------------------------------------- 1 | import main 2 | x = 107 3 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_absolute_error_circular_5/main.py: -------------------------------------------------------------------------------- 1 | import main2 2 | print(main2.x) 3 | 4 | if __name__ == '__main__': 5 | print() 6 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_absolute_error_circular_5/main2.py: -------------------------------------------------------------------------------- 1 | import main 2 | x = 108 3 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_absolute_error_circular_6/main.py: -------------------------------------------------------------------------------- 1 | import main2 2 | 3 | if __name__ == '__main__': 4 | print(main2.x) 5 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_absolute_error_circular_6/main2.py: -------------------------------------------------------------------------------- 1 | x = 109 2 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_absolute_error_circular_6/test.py: -------------------------------------------------------------------------------- 1 | from typing import Any, List 2 | 3 | from hstest.check_result import CheckResult 4 | from hstest.stage_test import StageTest 5 | from hstest.test_case import TestCase 6 | 7 | 8 | class TestImportAbsoluteErrorCircular6(StageTest): 9 | 10 | def generate(self) -> List[TestCase]: 11 | return [TestCase()] 12 | 13 | def check(self, reply: str, attach: Any) -> CheckResult: 14 | return CheckResult(reply == '109\n', '') 15 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_package/random_module/in1/in2/main2.py: -------------------------------------------------------------------------------- 1 | x = 1011 2 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_package/random_module/main.py: -------------------------------------------------------------------------------- 1 | from in1.in2.main2 import x 2 | print(x) 3 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_package/test.py: -------------------------------------------------------------------------------- 1 | from typing import Any, List 2 | 3 | from hstest.check_result import CheckResult 4 | from hstest.stage_test import StageTest 5 | from hstest.test_case import TestCase 6 | 7 | 8 | class TestImportPackage(StageTest): 9 | source = 'random_module.main' 10 | 11 | def generate(self) -> List[TestCase]: 12 | return [TestCase()] 13 | 14 | def check(self, reply: str, attach: Any) -> CheckResult: 15 | return CheckResult(reply == '1011\n', '') 16 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_package_2/random_module/in1/in2/main2.py: -------------------------------------------------------------------------------- 1 | x = 1011 2 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_package_2/random_module/main.py: -------------------------------------------------------------------------------- 1 | from .in1.in2.main2 import x 2 | print(x) 3 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_package_2/test.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from typing import Any, List 3 | 4 | from hstest.check_result import CheckResult 5 | from hstest.stage_test import StageTest 6 | from hstest.test_case import TestCase 7 | 8 | 9 | @unittest.skip('Relative imports doesn\'t work') 10 | class TestImportPackage2(StageTest): 11 | source = 'random_module.main' 12 | 13 | def generate(self) -> List[TestCase]: 14 | return [TestCase()] 15 | 16 | def check(self, reply: str, attach: Any) -> CheckResult: 17 | return CheckResult(reply == '10\n', '') 18 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_package_3/random_module/in1/file.py: -------------------------------------------------------------------------------- 1 | y = 2012 2 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_package_3/random_module/in1/in2/main2.py: -------------------------------------------------------------------------------- 1 | x = 1013 2 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_package_3/random_module/main.py: -------------------------------------------------------------------------------- 1 | import in1.in2.main2 2 | import in1.file 3 | print(in1.in2.main2.x + in1.file.y) 4 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_package_3/test.py: -------------------------------------------------------------------------------- 1 | from typing import Any, List 2 | 3 | from hstest.check_result import CheckResult 4 | from hstest.stage_test import StageTest 5 | from hstest.test_case import TestCase 6 | 7 | 8 | class TestImportPackage3(StageTest): 9 | source = 'random_module.main' 10 | 11 | def generate(self) -> List[TestCase]: 12 | return [TestCase()] 13 | 14 | def check(self, reply: str, attach: Any) -> CheckResult: 15 | return CheckResult(reply == '3025\n', '') 16 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_package_4/random_module/in1/file.py: -------------------------------------------------------------------------------- 1 | y = 2014 2 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_package_4/random_module/in1/in2/main2.py: -------------------------------------------------------------------------------- 1 | x = 1015 2 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_package_4/random_module/main.py: -------------------------------------------------------------------------------- 1 | from .in1.in2.main2 import x 2 | from .in1.file import y 3 | print(x + y) 4 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_package_5/random_module/in1/file.py: -------------------------------------------------------------------------------- 1 | y = 2030 2 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_package_5/random_module/in1/in2/main2.py: -------------------------------------------------------------------------------- 1 | x = 1031 2 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_package_5/random_module/main.py: -------------------------------------------------------------------------------- 1 | import in1.in2.main2 as m 2 | import in1.file as f 3 | print(m.x + f.y) 4 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_package_5/test.py: -------------------------------------------------------------------------------- 1 | from typing import Any, List 2 | 3 | from hstest.check_result import CheckResult 4 | from hstest.stage_test import StageTest 5 | from hstest.test_case import TestCase 6 | 7 | 8 | class TestImportPackage5(StageTest): 9 | source = 'random_module.main' 10 | 11 | def generate(self) -> List[TestCase]: 12 | return [TestCase()] 13 | 14 | def check(self, reply: str, attach: Any) -> CheckResult: 15 | return CheckResult(reply == '3061\n', '') 16 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_package_6/random_module/in1/file.py: -------------------------------------------------------------------------------- 1 | y = 2032 2 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_package_6/random_module/in1/in2/main2.py: -------------------------------------------------------------------------------- 1 | x = 1033 2 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_package_6/random_module/main.py: -------------------------------------------------------------------------------- 1 | from in1.in2 import main2 2 | from in1 import file 3 | print(main2.x + file.y) 4 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_package_6/test.py: -------------------------------------------------------------------------------- 1 | from typing import Any, List 2 | 3 | from hstest.check_result import CheckResult 4 | from hstest.stage_test import StageTest 5 | from hstest.test_case import TestCase 6 | 7 | 8 | class TestImportPackage6(StageTest): 9 | source = 'random_module.main' 10 | 11 | def generate(self) -> List[TestCase]: 12 | return [TestCase()] 13 | 14 | def check(self, reply: str, attach: Any) -> CheckResult: 15 | return CheckResult(reply == '3065\n', '') 16 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_package_7/random_module/in1/file.py: -------------------------------------------------------------------------------- 1 | y = 2033 2 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_package_7/random_module/in1/in2/main2.py: -------------------------------------------------------------------------------- 1 | x = 1034 2 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_package_7/random_module/main.py: -------------------------------------------------------------------------------- 1 | from .in1.in2 import main2 2 | from .in1 import file 3 | print(main2.x + file.y) 4 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_relative/main.py: -------------------------------------------------------------------------------- 1 | from .main2 import x 2 | print(x) 3 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_relative/main2.py: -------------------------------------------------------------------------------- 1 | x = 1035 2 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_relative/test.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from typing import Any, List 3 | 4 | from hstest.check_result import CheckResult 5 | from hstest.stage_test import StageTest 6 | from hstest.test_case import TestCase 7 | 8 | 9 | @unittest.skip('Relative imports doesn\'t work') 10 | class TestImportRelative(StageTest): 11 | 12 | def generate(self) -> List[TestCase]: 13 | return [TestCase()] 14 | 15 | def check(self, reply: str, attach: Any) -> CheckResult: 16 | return CheckResult(reply == '1035\n', '') 17 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_relative_error/main.py: -------------------------------------------------------------------------------- 1 | from .main22 import x 2 | print(x) 3 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_relative_error/main2.py: -------------------------------------------------------------------------------- 1 | x = 1036 2 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_relative_error_2/main.py: -------------------------------------------------------------------------------- 1 | from .main2 import y 2 | print(x) 3 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_relative_error_2/main2.py: -------------------------------------------------------------------------------- 1 | x = 1037 2 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_relative_error_cilcullar/main.py: -------------------------------------------------------------------------------- 1 | from .main2 import x 2 | y = 5 3 | print(x) 4 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_import_relative_error_cilcullar/main2.py: -------------------------------------------------------------------------------- 1 | from .main import y 2 | x = 1038 3 | print(y) 4 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_two_files_suits_but_we_have_source/main1.py: -------------------------------------------------------------------------------- 1 | print('main1') 2 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_two_files_suits_but_we_have_source/main2.py: -------------------------------------------------------------------------------- 1 | print('main2') 2 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_two_files_suits_but_we_have_source_2/main1.py: -------------------------------------------------------------------------------- 1 | print('main1') 2 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_two_files_suits_but_we_have_source_2/main2.py: -------------------------------------------------------------------------------- 1 | print('main2') 2 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_two_files_suits_but_we_have_source_2/test.py: -------------------------------------------------------------------------------- 1 | from typing import Any, List 2 | 3 | from hstest import CheckResult, StageTest, TestCase 4 | 5 | 6 | class TestImportRelativeError2(StageTest): 7 | source = 'main1' 8 | 9 | def generate(self) -> List[TestCase]: 10 | return [TestCase()] 11 | 12 | def check(self, reply: str, attach: Any) -> CheckResult: 13 | return CheckResult(reply == 'main1\n', '') 14 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_two_files_suits_but_we_have_source_3/main1.py: -------------------------------------------------------------------------------- 1 | print('main1') 2 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_two_files_suits_but_we_have_source_3/main2.py: -------------------------------------------------------------------------------- 1 | print('main2') 2 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_two_files_suits_but_we_have_source_3/test.py: -------------------------------------------------------------------------------- 1 | from typing import Any, List 2 | 3 | from hstest import CheckResult, StageTest, TestCase 4 | 5 | 6 | class TestImportRelativeError2(StageTest): 7 | source = 'main2' 8 | 9 | def generate(self) -> List[TestCase]: 10 | return [TestCase()] 11 | 12 | def check(self, reply: str, attach: Any) -> CheckResult: 13 | return CheckResult(reply == 'main2\n', '') 14 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_two_files_suits_but_we_have_source_4/main1.py: -------------------------------------------------------------------------------- 1 | print('main1') 2 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_two_files_suits_but_we_have_source_4/main2.py: -------------------------------------------------------------------------------- 1 | print('main2') 2 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_two_files_suits_but_we_have_source_5/main1.py: -------------------------------------------------------------------------------- 1 | print('main1') 2 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_two_files_suits_but_we_have_source_5/main2.py: -------------------------------------------------------------------------------- 1 | print('main2') 2 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_two_files_suits_but_we_have_source_5/test.py: -------------------------------------------------------------------------------- 1 | from hstest import CheckResult, dynamic_test, StageTest, TestedProgram 2 | 3 | 4 | class TestImportRelativeError2(StageTest): 5 | @dynamic_test 6 | def test(self): 7 | pr = TestedProgram('main1') 8 | return CheckResult(pr.start() == 'main1\n', '') 9 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_two_files_suits_but_we_have_source_6/main1.py: -------------------------------------------------------------------------------- 1 | print('main1') 2 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_two_files_suits_but_we_have_source_6/main2.py: -------------------------------------------------------------------------------- 1 | print('main2') 2 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_two_files_suits_but_we_have_source_6/test.py: -------------------------------------------------------------------------------- 1 | from hstest import CheckResult, dynamic_test, StageTest, TestedProgram 2 | 3 | 4 | class TestImportRelativeError2(StageTest): 5 | @dynamic_test 6 | def test(self): 7 | pr = TestedProgram('main2') 8 | return CheckResult(pr.start() == 'main2\n', '') 9 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_two_files_suits_but_we_have_source_7/main1.py: -------------------------------------------------------------------------------- 1 | print('main1') 2 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_two_files_suits_but_we_have_source_7/main2.py: -------------------------------------------------------------------------------- 1 | print('main2') 2 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_two_files_suits_but_we_have_source_7/test.py: -------------------------------------------------------------------------------- 1 | from hstest import CheckResult, dynamic_test, StageTest, TestedProgram 2 | 3 | 4 | class TestImportRelativeError2(StageTest): 5 | source = 'main1' 6 | 7 | @dynamic_test 8 | def test(self): 9 | pr = TestedProgram() 10 | return CheckResult(pr.start() == 'main1\n', '') 11 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_two_files_suits_but_we_have_source_8/main1.py: -------------------------------------------------------------------------------- 1 | print('main1') 2 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_two_files_suits_but_we_have_source_8/main2.py: -------------------------------------------------------------------------------- 1 | print('main2') 2 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_two_files_suits_but_we_have_source_8/test.py: -------------------------------------------------------------------------------- 1 | from hstest import CheckResult, dynamic_test, StageTest, TestedProgram 2 | 3 | 4 | class TestImportRelativeError2(StageTest): 5 | source = 'main2' 6 | 7 | @dynamic_test 8 | def test(self): 9 | pr = TestedProgram() 10 | return CheckResult(pr.start() == 'main2\n', '') 11 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_two_files_suits_but_we_have_source_9/main1.py: -------------------------------------------------------------------------------- 1 | print('main1') 2 | -------------------------------------------------------------------------------- /tests/outcomes/imports/test_two_files_suits_but_we_have_source_9/main2.py: -------------------------------------------------------------------------------- 1 | print('main2') 2 | -------------------------------------------------------------------------------- /tests/outcomes/imports/user_main_file_not_exists_but_exists_other/main.py: -------------------------------------------------------------------------------- 1 | print(2030) 2 | -------------------------------------------------------------------------------- /tests/outcomes/imports/user_module_not_exists_but_exists_other/random_module/main.py: -------------------------------------------------------------------------------- 1 | print('2050') 2 | -------------------------------------------------------------------------------- /tests/outcomes/infinite_loop/infinite_loop_test_char/main.py: -------------------------------------------------------------------------------- 1 | import random 2 | 3 | while True: 4 | print("Long Line Long Line Long Line", random.random()) 5 | -------------------------------------------------------------------------------- /tests/outcomes/infinite_loop/infinite_loop_test_input_request/main.py: -------------------------------------------------------------------------------- 1 | 2 | while True: 3 | print("Long Line Long Line Long Line") 4 | try: 5 | print(input()) 6 | except Exception as ex: 7 | print(ex) 8 | -------------------------------------------------------------------------------- /tests/outcomes/infinite_loop/infinite_loop_test_line_1/main.py: -------------------------------------------------------------------------------- 1 | while True: 2 | print("Line") 3 | -------------------------------------------------------------------------------- /tests/outcomes/infinite_loop/infinite_loop_test_line_10/main.py: -------------------------------------------------------------------------------- 1 | while True: 2 | print("Line1") 3 | print("Line2") 4 | print("Line3") 5 | print("Line4") 6 | print("Line5") 7 | print("Line6") 8 | print("Line7") 9 | print("Line8") 10 | print("Line9") 11 | print("Line10") 12 | -------------------------------------------------------------------------------- /tests/outcomes/infinite_loop/infinite_loop_test_line_11/main.py: -------------------------------------------------------------------------------- 1 | while True: 2 | for i in range(25): 3 | print("Line", i) 4 | -------------------------------------------------------------------------------- /tests/outcomes/infinite_loop/infinite_loop_test_line_2/main.py: -------------------------------------------------------------------------------- 1 | while True: 2 | print("Line1") 3 | print("Line2") 4 | -------------------------------------------------------------------------------- /tests/outcomes/infinite_loop/infinite_loop_test_line_3/main.py: -------------------------------------------------------------------------------- 1 | while True: 2 | print("Line1") 3 | print("Line2") 4 | print("Line3") 5 | -------------------------------------------------------------------------------- /tests/outcomes/infinite_loop/infinite_loop_test_line_4/main.py: -------------------------------------------------------------------------------- 1 | while True: 2 | print("Line1") 3 | print("Line2") 4 | print("Line3") 5 | print("Line4") 6 | -------------------------------------------------------------------------------- /tests/outcomes/infinite_loop/infinite_loop_test_line_5/main.py: -------------------------------------------------------------------------------- 1 | while True: 2 | print("Line1") 3 | print("Line2") 4 | print("Line3") 5 | print("Line4") 6 | print("Line5") 7 | -------------------------------------------------------------------------------- /tests/outcomes/infinite_loop/infinite_loop_test_line_6/main.py: -------------------------------------------------------------------------------- 1 | while True: 2 | print("Line1") 3 | print("Line2") 4 | print("Line3") 5 | print("Line4") 6 | print("Line5") 7 | print("Line6") 8 | -------------------------------------------------------------------------------- /tests/outcomes/infinite_loop/infinite_loop_test_line_7/main.py: -------------------------------------------------------------------------------- 1 | while True: 2 | print("Line1") 3 | print("Line2") 4 | print("Line3") 5 | print("Line4") 6 | print("Line5") 7 | print("Line6") 8 | print("Line7") 9 | -------------------------------------------------------------------------------- /tests/outcomes/infinite_loop/infinite_loop_test_line_8/main.py: -------------------------------------------------------------------------------- 1 | while True: 2 | print("Line1") 3 | print("Line2") 4 | print("Line3") 5 | print("Line4") 6 | print("Line5") 7 | print("Line6") 8 | print("Line7") 9 | print("Line8") 10 | -------------------------------------------------------------------------------- /tests/outcomes/infinite_loop/infinite_loop_test_line_9/main.py: -------------------------------------------------------------------------------- 1 | while True: 2 | print("Line1") 3 | print("Line2") 4 | print("Line3") 5 | print("Line4") 6 | print("Line5") 7 | print("Line6") 8 | print("Line7") 9 | print("Line8") 10 | print("Line9") 11 | -------------------------------------------------------------------------------- /tests/outcomes/infinite_loop/infinite_loop_test_not_working/main.py: -------------------------------------------------------------------------------- 1 | for i in range(1000): 2 | print("Line") 3 | -------------------------------------------------------------------------------- /tests/outcomes/input_handle/exception_while_reading/main.py: -------------------------------------------------------------------------------- 1 | def get(): 2 | return int(input()) 3 | 4 | 5 | def get_num(): 6 | return get() 7 | 8 | 9 | def get_line(): 10 | return get_num() 11 | 12 | 13 | print(get_line()) 14 | -------------------------------------------------------------------------------- /tests/outcomes/input_handle/exception_while_reading_2/main.py: -------------------------------------------------------------------------------- 1 | print(input()) 2 | print(input()) 3 | print(input()) 4 | -------------------------------------------------------------------------------- /tests/outcomes/input_handle/success_but_not_used_input_1/main.py: -------------------------------------------------------------------------------- 1 | first_line = int(input()) 2 | print(first_line) 3 | if first_line != 1: 4 | second_line = input() 5 | print(second_line) 6 | -------------------------------------------------------------------------------- /tests/outcomes/input_handle/success_but_not_used_input_2/main.py: -------------------------------------------------------------------------------- 1 | print('HELLO') 2 | print(input()) 3 | print(input()) 4 | -------------------------------------------------------------------------------- /tests/outcomes/input_handle/test_not_run_not_needed_input_funcs/main.py: -------------------------------------------------------------------------------- 1 | print('1') 2 | print('2') 3 | line_3 = input() 4 | print('5') 5 | line_4 = input() 6 | print('6') 7 | -------------------------------------------------------------------------------- /tests/outcomes/input_handle/test_not_run_not_needed_input_funcs/test.py: -------------------------------------------------------------------------------- 1 | from typing import Any, List 2 | 3 | from hstest.check_result import CheckResult 4 | from hstest.stage_test import StageTest 5 | from hstest.test_case import TestCase 6 | 7 | 8 | class TestNotRunNotNeededInputFuncs(StageTest): 9 | 10 | def generate(self) -> List[TestCase]: 11 | return [ 12 | TestCase(stdin=[lambda x: '3\n4', lambda x: 0 / 0]) 13 | ] 14 | 15 | def check(self, reply: str, attach: Any) -> CheckResult: 16 | return CheckResult.correct() 17 | -------------------------------------------------------------------------------- /tests/outcomes/input_handle/test_out_of_input_1/main.py: -------------------------------------------------------------------------------- 1 | for i in range(6): 2 | print(input()) 3 | -------------------------------------------------------------------------------- /tests/outcomes/input_handle/test_out_of_input_2/main.py: -------------------------------------------------------------------------------- 1 | for i in range(6): 2 | print(input()) 3 | -------------------------------------------------------------------------------- /tests/outcomes/input_handle/test_out_of_input_3/main.py: -------------------------------------------------------------------------------- 1 | for i in range(6): 2 | print(input()) 3 | -------------------------------------------------------------------------------- /tests/outcomes/input_handle/test_out_of_input_4/main.py: -------------------------------------------------------------------------------- 1 | for i in range(6): 2 | print(input()) 3 | -------------------------------------------------------------------------------- /tests/outcomes/lib/exception_in_user_code/main.py: -------------------------------------------------------------------------------- 1 | print(123) 2 | print(0 / 0) 3 | -------------------------------------------------------------------------------- /tests/outcomes/lib/exception_in_user_code_2/main.py: -------------------------------------------------------------------------------- 1 | print(123) 2 | try: 3 | print(0 / 0) 4 | except ArithmeticError: 5 | print(0 / 0) 6 | -------------------------------------------------------------------------------- /tests/outcomes/lib/exception_in_user_code_3/module/main.py: -------------------------------------------------------------------------------- 1 | print(""" 2 | Coffee is ready!""", raise_error_here) 3 | -------------------------------------------------------------------------------- /tests/outcomes/lib/order/test_order_complex/main.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/outcomes/lib/success/main.py: -------------------------------------------------------------------------------- 1 | a = int(input()) 2 | b = int(input()) 3 | print(a + b) 4 | -------------------------------------------------------------------------------- /tests/outcomes/lib/success/test.py: -------------------------------------------------------------------------------- 1 | from typing import Any, List 2 | 3 | from hstest.check_result import CheckResult 4 | from hstest.stage_test import StageTest 5 | from hstest.test_case import TestCase 6 | 7 | 8 | class SuccessTest(StageTest): 9 | 10 | def generate(self) -> List[TestCase]: 11 | return [ 12 | TestCase(stdin='2\n4', attach='6\n'), 13 | TestCase(stdin='1\n3', attach='4\n'), 14 | ] 15 | 16 | def check(self, reply: str, attach: Any) -> CheckResult: 17 | return CheckResult(reply == attach, '') 18 | -------------------------------------------------------------------------------- /tests/outcomes/lib/success2/folder/main.py: -------------------------------------------------------------------------------- 1 | a = int(input()) 2 | b = int(input()) 3 | print(a + b) 4 | -------------------------------------------------------------------------------- /tests/outcomes/lib/test_case_same_objects/main.py: -------------------------------------------------------------------------------- 1 | print('Hello') 2 | print(input()) 3 | print(input()) 4 | print(input()) 5 | -------------------------------------------------------------------------------- /tests/outcomes/lib/test_case_same_objects/test.py: -------------------------------------------------------------------------------- 1 | from typing import Any, List 2 | 3 | from hstest.check_result import CheckResult 4 | from hstest.stage_test import StageTest 5 | from hstest.test_case import TestCase 6 | 7 | 8 | class TestCaseSameObjects(StageTest): 9 | 10 | def generate(self) -> List[TestCase]: 11 | test = TestCase(stdin=[(3, lambda x: x)], attach="Hello\nHello\nHello\nHello\n") 12 | return [test] * 5 13 | 14 | def check(self, reply: str, attach: Any) -> CheckResult: 15 | return CheckResult(reply == attach, '') 16 | -------------------------------------------------------------------------------- /tests/outcomes/lib/test_copy_to_attach/main.py: -------------------------------------------------------------------------------- 1 | print(input(), end='') 2 | -------------------------------------------------------------------------------- /tests/outcomes/lib/test_curr_test_case/main.py: -------------------------------------------------------------------------------- 1 | print(input()) 2 | -------------------------------------------------------------------------------- /tests/outcomes/lib/test_curr_test_num/main.py: -------------------------------------------------------------------------------- 1 | print(input()) 2 | -------------------------------------------------------------------------------- /tests/outcomes/lib/test_custom_checker/main.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | print(len(sys.argv[1:])) 4 | print(*sys.argv[1:], sep='\n') 5 | -------------------------------------------------------------------------------- /tests/outcomes/lib/test_custom_checker_fail/main.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | print(len(sys.argv[1:])) 4 | print(*sys.argv[1:], sep='\n') 5 | -------------------------------------------------------------------------------- /tests/outcomes/lib/test_nbsp_in_output/main.py: -------------------------------------------------------------------------------- 1 | print("1\u00a02 3", end='') 2 | -------------------------------------------------------------------------------- /tests/outcomes/lib/test_nbsp_in_output/test.py: -------------------------------------------------------------------------------- 1 | from typing import Any, List 2 | 3 | from hstest.check_result import CheckResult 4 | from hstest.stage_test import StageTest 5 | from hstest.test_case import TestCase 6 | 7 | 8 | class TestNbspInOutput(StageTest): 9 | 10 | def generate(self) -> List[TestCase]: 11 | return [ 12 | TestCase() 13 | ] 14 | 15 | def check(self, reply: str, attach: Any) -> CheckResult: 16 | return CheckResult(reply == "1\u00202\u00203", '') 17 | -------------------------------------------------------------------------------- /tests/outcomes/lib/test_run_test_inside_test/main.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperskill/hs-test-python/0339e9ac29cce939d994b8c4ed85a6daa41d4306/tests/outcomes/lib/test_run_test_inside_test/main.py -------------------------------------------------------------------------------- /tests/outcomes/long_output/long_output_on_raise_wrong_answer/main.py: -------------------------------------------------------------------------------- 1 | for i in range(600): 2 | print(f"A {i} line") 3 | -------------------------------------------------------------------------------- /tests/outcomes/long_output/long_output_on_raise_wrong_answer/test.py: -------------------------------------------------------------------------------- 1 | from hstest import dynamic_test, TestedProgram, WrongAnswer 2 | from hstest.testing.unittest.user_error_test import UserErrorTest 3 | 4 | 5 | class TestWrongOutputWithTooLongOutput(UserErrorTest): 6 | contain = [f'A {i} line' for i in range(350, 600)] 7 | not_contain = [f'A {i} line' for i in range(0, 350)] 8 | 9 | @dynamic_test 10 | def test(self): 11 | program = TestedProgram() 12 | program.start() 13 | raise WrongAnswer('') 14 | -------------------------------------------------------------------------------- /tests/outcomes/long_output/long_output_on_unexpected_error/main.py: -------------------------------------------------------------------------------- 1 | for i in range(600): 2 | print(f"A {i} line") 3 | -------------------------------------------------------------------------------- /tests/outcomes/long_output/long_output_on_unexpected_error/test.py: -------------------------------------------------------------------------------- 1 | from hstest import dynamic_test, TestedProgram, wrong 2 | from hstest.testing.unittest.unexepected_error_test import UnexpectedErrorTest 3 | 4 | 5 | class TestWrongOutputWithTooLongOutput(UnexpectedErrorTest): 6 | contain = [f'A {i} line' for i in range(350, 600)] 7 | not_contain = [f'A {i} line' for i in range(0, 350)] 8 | 9 | @dynamic_test 10 | def test(self): 11 | program = TestedProgram() 12 | program.start() 13 | a = 2 / 0 # noqa: F841 14 | return wrong('') 15 | -------------------------------------------------------------------------------- /tests/outcomes/long_output/long_output_with_arguments/main.py: -------------------------------------------------------------------------------- 1 | for i in range(251): 2 | print(f"A {i} line") 3 | -------------------------------------------------------------------------------- /tests/outcomes/long_output/long_output_with_arguments/test.py: -------------------------------------------------------------------------------- 1 | from hstest import dynamic_test, TestedProgram, wrong 2 | from hstest.testing.unittest.user_error_test import UserErrorTest 3 | 4 | 5 | class TestWrongOutputWithTooLongOutput(UserErrorTest): 6 | contain = "Arguments: -arg test\n\n[last 250 lines of output are shown, 1 skipped]" 7 | 8 | @dynamic_test 9 | def test(self): 10 | program = TestedProgram() 11 | program.start("-arg", "test") 12 | return wrong('') 13 | -------------------------------------------------------------------------------- /tests/outcomes/long_output/test_label_on_long_output/main.py: -------------------------------------------------------------------------------- 1 | for i in range(251): 2 | print(f"A {i} line") 3 | -------------------------------------------------------------------------------- /tests/outcomes/long_output/test_label_on_not_enough_long_output/main.py: -------------------------------------------------------------------------------- 1 | for i in range(250): 2 | print(f"A {i} line") 3 | -------------------------------------------------------------------------------- /tests/outcomes/long_output/test_label_on_not_enough_long_output/test.py: -------------------------------------------------------------------------------- 1 | from hstest import dynamic_test, TestedProgram, wrong 2 | from hstest.testing.unittest.user_error_test import UserErrorTest 3 | 4 | 5 | class TestWrongOutputWithTooLongOutput(UserErrorTest): 6 | contain = [f'A {i} line' for i in range(1, 250)] 7 | not_contain = '[last 250 lines of output are shown, 1 skipped]' 8 | 9 | @dynamic_test 10 | def test(self): 11 | program = TestedProgram() 12 | program.start() 13 | return wrong('') 14 | -------------------------------------------------------------------------------- /tests/outcomes/long_output/wrong_output_with_too_long_output/main.py: -------------------------------------------------------------------------------- 1 | for i in range(600): 2 | print(f"A {i} line") 3 | -------------------------------------------------------------------------------- /tests/outcomes/long_output/wrong_output_with_too_long_output/test.py: -------------------------------------------------------------------------------- 1 | from hstest import dynamic_test, TestedProgram, wrong 2 | from hstest.testing.unittest.user_error_test import UserErrorTest 3 | 4 | 5 | class TestWrongOutputWithTooLongOutput(UserErrorTest): 6 | contain = [f'A {i} line' for i in range(350, 600)] 7 | not_contain = [f'A {i} line' for i in range(0, 350)] 8 | 9 | @dynamic_test 10 | def test(self): 11 | program = TestedProgram() 12 | program.start() 13 | return wrong('') 14 | -------------------------------------------------------------------------------- /tests/outcomes/multiple_empty_line_in_input/test_input_method_with_multiple_empty_line_input/main.py: -------------------------------------------------------------------------------- 1 | i = 1 2 | 3 | while True: 4 | inp = input() 5 | if inp == '': 6 | print('empty') 7 | else: 8 | print(inp) 9 | i += 1 10 | -------------------------------------------------------------------------------- /tests/outcomes/multiple_empty_line_in_input/test_multiple_line_at_the_end_and_in_the_middle_of_input/main.py: -------------------------------------------------------------------------------- 1 | i = 1 2 | 3 | while True: 4 | inp = input() 5 | if inp == '': 6 | print('Empty line') 7 | else: 8 | print(inp) 9 | print(f"Input line number {i}") 10 | i += 1 11 | -------------------------------------------------------------------------------- /tests/outcomes/multiple_empty_line_in_input/test_multiple_line_at_the_end_of_input/main.py: -------------------------------------------------------------------------------- 1 | i = 1 2 | 3 | while True: 4 | inp = input() 5 | if inp == '': 6 | print('Empty line') 7 | else: 8 | print(inp) 9 | print(f"Input line number {i}") 10 | i += 1 11 | -------------------------------------------------------------------------------- /tests/outcomes/parametrized_tests/correct/test_parametrized_data_2/test.py: -------------------------------------------------------------------------------- 1 | from hstest.check_result import CheckResult 2 | from hstest.dynamic.dynamic_test import dynamic_test 3 | from hstest.stage_test import StageTest 4 | 5 | 6 | class TestParametrizedData2(StageTest): 7 | test_data = [1, 2, 3, 4, 5] 8 | 9 | counter = 0 10 | 11 | @dynamic_test(data=test_data) 12 | def test(self, a): 13 | self.counter += 1 14 | print(a) 15 | return CheckResult(self.counter == a, '') 16 | -------------------------------------------------------------------------------- /tests/outcomes/parametrized_tests/correct/test_parametrized_data_3/test.py: -------------------------------------------------------------------------------- 1 | from hstest.check_result import CheckResult 2 | from hstest.dynamic.dynamic_test import dynamic_test 3 | from hstest.stage_test import StageTest 4 | 5 | 6 | class TestParametrizedData3(StageTest): 7 | test_data = [ 8 | [1], [2], [3], [4], [5] 9 | ] 10 | 11 | counter = 0 12 | 13 | @dynamic_test(data=test_data) 14 | def test(self, a): 15 | self.counter += 1 16 | print(a) 17 | return CheckResult(self.counter == a, '') 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/area/pandas/test.py: -------------------------------------------------------------------------------- 1 | from hstest import TestedProgram 2 | from hstest.dynamic.dynamic_test import dynamic_test 3 | from hstest.stage import PlottingTest 4 | from hstest.testing.plotting.drawing.drawing_library import DrawingLibrary 5 | from tests.outcomes.plot.area.test_area_drawing import test_area_drawing 6 | 7 | 8 | class TestPandasArea(PlottingTest): 9 | @dynamic_test 10 | def test(self): 11 | program = TestedProgram() 12 | program.start() 13 | 14 | return test_area_drawing(self.all_figures(), 1, DrawingLibrary.pandas) 15 | -------------------------------------------------------------------------------- /tests/outcomes/plot/bar/matplotlib/main.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | fig, ax = plt.subplots() 10 | 11 | plt.bar([1, 2, 4, 6], 5) 12 | ax.bar([1, 2, 4, 6], 6) 13 | 14 | plt.barh([1, 2, 4, 6], 7) 15 | ax.barh([1, 2, 4, 6], 8) 16 | 17 | plt.show() 18 | 19 | 20 | plot() 21 | -------------------------------------------------------------------------------- /tests/outcomes/plot/bar/pandas/test_no_args/pandas_dataframe_plot_no_x_no_y.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import matplotlib.pyplot as plt 4 | import seaborn as sns 5 | import pandas as pd 6 | import numpy as np 7 | except ModuleNotFoundError: 8 | return 9 | 10 | df = pd.DataFrame({'lab': [2, 3, 4, 5, 6], 'val': [3, 4, 5, 6, 7]}) 11 | 12 | df.plot.bar() 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/bar/seaborn/main.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import matplotlib.pyplot as plt 4 | import seaborn as sns 5 | import pandas as pd 6 | import numpy as np 7 | except ModuleNotFoundError: 8 | return 9 | 10 | df = pd.DataFrame({'lab': ['A', 'B', 'C'], 'val': [10, 30, 20], 'val1': [5, 10, 15]}) 11 | 12 | sns.barplot(x='lab', y='val', data=df) 13 | plt.show() 14 | 15 | sns.barplot(y='val', data=df) 16 | plt.show() 17 | 18 | sns.barplot(x='val', data=df) 19 | plt.show() 20 | 21 | 22 | plot() 23 | -------------------------------------------------------------------------------- /tests/outcomes/plot/bar/universal_tests/data_no_x/pandas_column_plot.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]), 10 | columns=['one', 'two']) 11 | 12 | df.one.plot.bar() 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/bar/universal_tests/data_no_x/pandas_column_plot_kind.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]), 10 | columns=['one', 'two']) 11 | 12 | df.one.plot(kind='bar') 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/bar/universal_tests/data_no_x/pandas_column_string_plot.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]), 10 | columns=['one', 'two']) 11 | 12 | df['one'].plot.bar() 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/bar/universal_tests/data_no_x/pandas_column_string_plot_kind.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]), 10 | columns=['one', 'two']) 11 | 12 | df['one'].plot(kind='bar') 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/bar/universal_tests/data_no_x/pandas_dataframe_plot.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([1, 2, 3, 4, 5]), 10 | columns=['one']) 11 | 12 | df.plot.bar() 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/bar/universal_tests/data_no_x/pandas_dataframe_plot_kind.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([1, 2, 3, 4, 5]), 10 | columns=['one']) 11 | 12 | df.plot(kind='bar') 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/bar/universal_tests/data_no_x/pandas_dataframe_plot_kind_y.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2, 3], [2, 3, 4], [3, 4, 5], [4, 5, 6], [5, 6, 7]]), 10 | columns=['one', 'two', 'three']) 11 | 12 | df.plot(y='one', kind='bar') 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/bar/universal_tests/data_no_x/pandas_dataframe_plot_y.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2, 3], [2, 3, 4], [3, 4, 5], [4, 5, 6], [5, 6, 7]]), 10 | columns=['one', 'two', 'three']) 11 | 12 | df.plot.bar(y='one') 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/bar/universal_tests/data_no_x/pandas_series_plot.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | ser = pd.Series(data=np.array([1, 2, 3, 4, 5])) 10 | ser.plot.bar() 11 | 12 | plt.show() 13 | 14 | 15 | plot() 16 | -------------------------------------------------------------------------------- /tests/outcomes/plot/bar/universal_tests/data_no_x/pandas_series_plot_kind.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | ser = pd.Series(data=np.array([1, 2, 3, 4, 5])) 10 | ser.plot(kind='bar') 11 | 12 | plt.show() 13 | 14 | 15 | plot() 16 | -------------------------------------------------------------------------------- /tests/outcomes/plot/bar/universal_tests/data_simple/matplotlib_data_dataframe_ax.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | fig, ax = plt.subplots() 10 | 11 | df = pd.DataFrame(np.array([[1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]), 12 | columns=['one', 'two']) 13 | 14 | ax.bar(x='one', height='two', data=df) 15 | plt.show() 16 | 17 | 18 | plot() 19 | -------------------------------------------------------------------------------- /tests/outcomes/plot/bar/universal_tests/data_simple/matplotlib_data_dataframe_plt.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]), 10 | columns=['one', 'two']) 11 | 12 | plt.bar(x='one', height='two', data=df) 13 | plt.show() 14 | 15 | 16 | plot() 17 | -------------------------------------------------------------------------------- /tests/outcomes/plot/bar/universal_tests/data_simple/matplotlib_x_array_ax.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | fig, ax = plt.subplots() 10 | 11 | ax.bar(np.array([1, 2, 3, 4, 5]), [2, 3, 4, 5, 6]) 12 | plt.show() 13 | 14 | 15 | plot() 16 | -------------------------------------------------------------------------------- /tests/outcomes/plot/bar/universal_tests/data_simple/matplotlib_x_array_plt.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | plt.bar(np.array([1, 2, 3, 4, 5]), [2, 3, 4, 5, 6]) 10 | plt.show() 11 | 12 | 13 | plot() 14 | -------------------------------------------------------------------------------- /tests/outcomes/plot/bar/universal_tests/data_simple/matplotlib_x_column_ax.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | fig, ax = plt.subplots() 10 | 11 | df = pd.DataFrame(np.array([[1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]), 12 | columns=['one', 'two']) 13 | 14 | ax.bar(df.one, df.two) 15 | plt.show() 16 | 17 | 18 | plot() 19 | -------------------------------------------------------------------------------- /tests/outcomes/plot/bar/universal_tests/data_simple/matplotlib_x_column_plt.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]), 10 | columns=['one', 'two']) 11 | 12 | plt.bar(df.one, df.two) 13 | plt.show() 14 | 15 | 16 | plot() 17 | -------------------------------------------------------------------------------- /tests/outcomes/plot/bar/universal_tests/data_simple/matplotlib_x_column_string_ax.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | fig, ax = plt.subplots() 10 | 11 | df = pd.DataFrame(np.array([[1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]), 12 | columns=['one', 'two']) 13 | 14 | ax.bar(df['one'], df['two']) 15 | plt.show() 16 | 17 | 18 | plot() 19 | -------------------------------------------------------------------------------- /tests/outcomes/plot/bar/universal_tests/data_simple/matplotlib_x_column_string_plt.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]), 10 | columns=['one', 'two']) 11 | 12 | plt.bar(df['one'], df['two']) 13 | plt.show() 14 | 15 | 16 | plot() 17 | -------------------------------------------------------------------------------- /tests/outcomes/plot/bar/universal_tests/data_simple/matplotlib_x_dataframe_ax.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | fig, ax = plt.subplots() 10 | 11 | df = pd.DataFrame(np.array([1, 2, 3, 4, 5]), 12 | columns=['one']) 13 | 14 | ax.bar(df.one, height=np.array([2, 3, 4, 5, 6])) 15 | plt.show() 16 | 17 | 18 | plot() 19 | -------------------------------------------------------------------------------- /tests/outcomes/plot/bar/universal_tests/data_simple/matplotlib_x_dataframe_plt.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([1, 2, 3, 4, 5]), 10 | columns=['one']) 11 | 12 | plt.bar(df['one'], height=np.array([2, 3, 4, 5, 6])) 13 | plt.show() 14 | 15 | 16 | plot() 17 | -------------------------------------------------------------------------------- /tests/outcomes/plot/bar/universal_tests/data_simple/matplotlib_x_list_ax.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | fig, ax = plt.subplots() 10 | 11 | ax.bar([1, 2, 3, 4, 5], [2, 3, 4, 5, 6]) 12 | plt.show() 13 | 14 | 15 | plot() 16 | -------------------------------------------------------------------------------- /tests/outcomes/plot/bar/universal_tests/data_simple/matplotlib_x_list_plt.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | plt.bar([1, 2, 3, 4, 5], [2, 3, 4, 5, 6]) 10 | plt.show() 11 | 12 | 13 | plot() 14 | -------------------------------------------------------------------------------- /tests/outcomes/plot/bar/universal_tests/data_simple/matplotlib_x_series_ax.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | fig, ax = plt.subplots() 10 | 11 | ser = pd.Series(data=np.array([1, 2, 3, 4, 5])) 12 | height = pd.Series(data=np.array([2, 3, 4, 5, 6])) 13 | 14 | ax.bar(ser, height) 15 | plt.show() 16 | 17 | 18 | plot() 19 | -------------------------------------------------------------------------------- /tests/outcomes/plot/bar/universal_tests/data_simple/matplotlib_x_series_plt.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | ser = pd.Series(data=np.array([1, 2, 3, 4, 5])) 10 | height = pd.Series(data=np.array([2, 3, 4, 5, 6])) 11 | 12 | plt.bar(ser, height) 13 | plt.show() 14 | 15 | 16 | plot() 17 | -------------------------------------------------------------------------------- /tests/outcomes/plot/bar/universal_tests/data_simple/matplotlib_x_tuple_ax.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | fig, ax = plt.subplots() 10 | 11 | ax.bar((1, 2, 3, 4, 5), (2, 3, 4, 5, 6)) 12 | plt.show() 13 | 14 | 15 | plot() 16 | -------------------------------------------------------------------------------- /tests/outcomes/plot/bar/universal_tests/data_simple/matplotlib_x_tuple_plt.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | plt.bar((1, 2, 3, 4, 5), (2, 3, 4, 5, 6)) 10 | plt.show() 11 | 12 | 13 | plot() 14 | -------------------------------------------------------------------------------- /tests/outcomes/plot/bar/universal_tests/data_simple/pandas_dataframe_plot_kind_x.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]), 10 | columns=['one', 'two']) 11 | 12 | df.plot(x='one', kind='bar') 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/bar/universal_tests/data_simple/pandas_dataframe_plot_kind_xy.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2, 3], [2, 3, 4], [3, 4, 5], [4, 5, 6], [5, 6, 7]]), 10 | columns=['one', 'two', 'three']) 11 | 12 | df.plot(x='one', y='two', kind='bar') 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/bar/universal_tests/data_simple/pandas_dataframe_plot_x.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]), 10 | columns=['one', 'two']) 11 | 12 | df.plot.bar(x='one') 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/bar/universal_tests/data_simple/pandas_dataframe_plot_xy.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2, 3], [2, 3, 4], [3, 4, 5], [4, 5, 6], [5, 6, 7]]), 10 | columns=['one', 'two', 'three']) 11 | 12 | df.plot(x='one', y='two', kind='bar') 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/bar/universal_tests/data_simple/pandas_series_plot_kind.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | ser = pd.Series(data=np.array([1, 2, 3, 4, 5, 6])) 10 | ser[1:].plot(kind='bar') 11 | 12 | plt.show() 13 | 14 | 15 | plot() 16 | -------------------------------------------------------------------------------- /tests/outcomes/plot/bar/universal_tests/data_two_pics/pandas_dataframe_plot_kind_x.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2, 3], [2, 3, 4], [3, 4, 5], [4, 5, 6], [5, 6, 7]]), 10 | columns=['one', 'two', 'three']) 11 | 12 | df.plot(x='one', kind='bar') 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/bar/universal_tests/data_two_pics/pandas_dataframe_plot_kind_xy.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2, 3, 4], [2, 3, 4, 5], [3, 4, 5, 6], [4, 5, 6, 7], [5, 6, 7, 8]]), 10 | columns=['one', 'two', 'three', 'four']) 11 | 12 | df.plot(x='one', y=['two', 'three'], kind='bar') 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/bar/universal_tests/data_two_pics/pandas_dataframe_plot_x.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2, 3], [2, 3, 4], [3, 4, 5], [4, 5, 6], [5, 6, 7]]), 10 | columns=['one', 'two', 'three']) 11 | 12 | df.plot.bar(x='one') 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/bar/universal_tests/data_two_pics/pandas_dataframe_plot_xy.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2, 3, 4], [2, 3, 4, 5], [3, 4, 5, 6], [4, 5, 6, 7], [5, 6, 7, 8]]), 10 | columns=['one', 'two', 'three', 'four']) 11 | 12 | df.plot.bar(x='one', y=['two', 'three']) 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/bar/universal_tests/data_two_pics_no_x/pandas_dataframe_plot.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]), 10 | columns=['one', 'two']) 11 | 12 | df.plot.bar() 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/bar/universal_tests/data_two_pics_no_x/pandas_dataframe_plot_kind.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]), 10 | columns=['one', 'two']) 11 | 12 | df.plot(kind='bar') 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/bar/universal_tests/data_two_pics_no_x/pandas_dataframe_plot_kind_y.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2, 3], [2, 3, 4], [3, 4, 5], [4, 5, 6], [5, 6, 7]]), 10 | columns=['one', 'two', 'three']) 11 | 12 | df.plot(y=['one', 'two'], kind='bar') 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/bar/universal_tests/data_two_pics_no_x/pandas_dataframe_plot_y.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2, 3], [2, 3, 4], [3, 4, 5], [4, 5, 6], [5, 6, 7]]), 10 | columns=['one', 'two', 'three']) 11 | 12 | df.plot.bar(y=['one', 'two']) 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/box/matplotlib/test_data/main.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | fig, ax = plt.subplots(figsize=(1, 2)) 10 | 11 | ax.boxplot([1, 2, 3, 4]) 12 | plt.boxplot([1, 2, 3, 4]) 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/box/pandas/main.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | import seaborn as sns 7 | except ModuleNotFoundError: 8 | return 9 | 10 | df = pd.DataFrame(np.random.randn(10, 2), 11 | columns=['Col1', 'Col2']) 12 | df['X'] = pd.Series(['A', 'A', 'A', 'A', 'A', 13 | 'B', 'B', 'B', 'B', 'B']) 14 | boxplot = df.boxplot(by='X') 15 | plt.show() 16 | 17 | 18 | plot() 19 | -------------------------------------------------------------------------------- /tests/outcomes/plot/box/pandas/test.py: -------------------------------------------------------------------------------- 1 | from hstest import TestedProgram 2 | from hstest.dynamic.dynamic_test import dynamic_test 3 | from hstest.stage import PlottingTest 4 | from hstest.testing.plotting.drawing.drawing_library import DrawingLibrary 5 | from tests.outcomes.plot.box.test_box_drawing import test_box_drawing 6 | 7 | 8 | class TestPandasBox(PlottingTest): 9 | @dynamic_test 10 | def test(self): 11 | program = TestedProgram() 12 | program.start() 13 | 14 | return test_box_drawing(self.all_figures(), 2, DrawingLibrary.pandas) 15 | -------------------------------------------------------------------------------- /tests/outcomes/plot/box/seaborn/main.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | import seaborn as sns 7 | except ModuleNotFoundError: 8 | return 9 | 10 | tips = sns.load_dataset("tips") 11 | ax = sns.boxplot(x=tips["total_bill"]) 12 | 13 | plt.show() 14 | 15 | 16 | plot() 17 | -------------------------------------------------------------------------------- /tests/outcomes/plot/box/seaborn/test.py: -------------------------------------------------------------------------------- 1 | from hstest import TestedProgram 2 | from hstest.dynamic.dynamic_test import dynamic_test 3 | from hstest.stage import PlottingTest 4 | from hstest.testing.plotting.drawing.drawing_library import DrawingLibrary 5 | from tests.outcomes.plot.box.test_box_drawing import test_box_drawing 6 | 7 | 8 | class TestSeabornBox(PlottingTest): 9 | @dynamic_test 10 | def test(self): 11 | program = TestedProgram() 12 | program.start() 13 | 14 | return test_box_drawing(self.all_figures(), 1, DrawingLibrary.seaborn) 15 | -------------------------------------------------------------------------------- /tests/outcomes/plot/cat/seaborn/main.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import matplotlib.pyplot as plt 4 | import seaborn as sns 5 | import pandas as pd 6 | import numpy as np 7 | except ModuleNotFoundError: 8 | return 9 | 10 | exercise = sns.load_dataset("exercise") 11 | g = sns.catplot(x="time", y="pulse", hue="kind", data=exercise) 12 | 13 | plt.show() 14 | 15 | 16 | plot() 17 | -------------------------------------------------------------------------------- /tests/outcomes/plot/cat/seaborn/test.py: -------------------------------------------------------------------------------- 1 | from hstest import TestedProgram 2 | from hstest.dynamic.dynamic_test import dynamic_test 3 | from hstest.stage import PlottingTest 4 | from hstest.testing.plotting.drawing.drawing_library import DrawingLibrary 5 | from tests.outcomes.plot.cat.test_cat_drawing import test_cat_drawing 6 | 7 | 8 | class TestSeabornCat(PlottingTest): 9 | @dynamic_test 10 | def test(self): 11 | program = TestedProgram() 12 | program.start() 13 | 14 | return test_cat_drawing(self.all_figures(), 1, DrawingLibrary.seaborn) 15 | -------------------------------------------------------------------------------- /tests/outcomes/plot/dis/pandas/main.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | import seaborn as sns 7 | except ModuleNotFoundError: 8 | return 9 | 10 | s = pd.Series([1, 2, 2.5, 3, 3.5, 4, 5]) 11 | ax = s.plot.kde() 12 | plt.show() 13 | 14 | 15 | plot() 16 | -------------------------------------------------------------------------------- /tests/outcomes/plot/dis/pandas/test.py: -------------------------------------------------------------------------------- 1 | from hstest import TestedProgram 2 | from hstest.dynamic.dynamic_test import dynamic_test 3 | from hstest.stage import PlottingTest 4 | from hstest.testing.plotting.drawing.drawing_library import DrawingLibrary 5 | from tests.outcomes.plot.dis.test_dis_drawing import test_dis_drawing 6 | 7 | 8 | class TestPandasDis(PlottingTest): 9 | @dynamic_test 10 | def test(self): 11 | program = TestedProgram() 12 | program.start() 13 | 14 | return test_dis_drawing(self.all_figures(), 1, DrawingLibrary.pandas) 15 | -------------------------------------------------------------------------------- /tests/outcomes/plot/dis/seaborn/main.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | import seaborn as sns 7 | except ModuleNotFoundError: 8 | return 9 | 10 | penguins = sns.load_dataset("penguins") 11 | sns.displot(data=penguins, x="flipper_length_mm") 12 | 13 | plt.show() 14 | 15 | 16 | plot() 17 | -------------------------------------------------------------------------------- /tests/outcomes/plot/dis/seaborn/test.py: -------------------------------------------------------------------------------- 1 | from hstest import TestedProgram 2 | from hstest.dynamic.dynamic_test import dynamic_test 3 | from hstest.stage import PlottingTest 4 | from hstest.testing.plotting.drawing.drawing_library import DrawingLibrary 5 | from tests.outcomes.plot.dis.test_dis_drawing import test_dis_drawing 6 | 7 | 8 | class TestSeabornDis(PlottingTest): 9 | @dynamic_test 10 | def test(self): 11 | program = TestedProgram() 12 | program.start() 13 | 14 | return test_dis_drawing(self.all_figures(), 1, DrawingLibrary.seaborn) 15 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hexbin/pandas/main.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import matplotlib.pyplot as plt 4 | import seaborn as sns 5 | import pandas as pd 6 | import numpy as np 7 | except ModuleNotFoundError: 8 | return 9 | 10 | n = 10000 11 | df = pd.DataFrame({'x': np.random.randn(n), 12 | 'y': np.random.randn(n)}) 13 | ax = df.plot.hexbin(x='x', y='y', gridsize=20) 14 | 15 | plt.show() 16 | 17 | 18 | plot() 19 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hexbin/pandas/test.py: -------------------------------------------------------------------------------- 1 | from hstest import TestedProgram 2 | from hstest.dynamic.dynamic_test import dynamic_test 3 | from hstest.stage import PlottingTest 4 | from hstest.testing.plotting.drawing.drawing_library import DrawingLibrary 5 | from tests.outcomes.plot.hexbin.test_hexbin_drawing import test_hexbin_drawing 6 | 7 | 8 | class TestPandasHexbin(PlottingTest): 9 | @dynamic_test 10 | def test(self): 11 | program = TestedProgram() 12 | program.start() 13 | 14 | return test_hexbin_drawing(self.all_figures(), 1, DrawingLibrary.pandas) 15 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/matplotlib/test_sorting_data/main.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | fig, ax = plt.subplots(figsize=(1, 2)) 10 | 11 | plt.hist([3, 2, 1]) 12 | plt.hist([3, 2, '1']) 13 | plt.hist(['3', '2', '1']) 14 | plt.hist([3.1, 2.1, 1]) 15 | plt.hist(['b', 'a', 'c']) 16 | plt.hist([1, 5, 2, '1']) 17 | 18 | plt.show() 19 | 20 | 21 | plot() 22 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/matplotlib/todo/x_data_with_weights_plt/main.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]), 10 | columns=['one', 'two']) 11 | 12 | plt.hist(x='one', weights='two', data=df) 13 | plt.show() 14 | 15 | plot() 16 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/matplotlib/todo/x_dataframe_plt/main.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]), 10 | columns=['one', 'two']) 11 | 12 | plt.hist(df) 13 | plt.show() 14 | 15 | plot() 16 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/seaborn/test_data/main.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import matplotlib.pyplot as plt 4 | import seaborn as sns 5 | import pandas as pd 6 | import numpy as np 7 | except ModuleNotFoundError: 8 | return 9 | 10 | df = pd.DataFrame(np.array([5, 2, 1, 4, 5, 3]), columns=['one']) 11 | 12 | sns.histplot( 13 | df, y="one" 14 | ) 15 | 16 | plt.show() 17 | 18 | sns.histplot( 19 | df, x="one" 20 | ) 21 | 22 | plt.show() 23 | 24 | 25 | plot() 26 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/seaborn/test_sorting_data/main.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import matplotlib.pyplot as plt 4 | import seaborn as sns 5 | import pandas as pd 6 | import numpy as np 7 | except ModuleNotFoundError: 8 | return 9 | 10 | df = pd.DataFrame(np.array([5, 4, 3, 2, 1, 3]), columns=['one']) 11 | 12 | sns.histplot( 13 | df, y="one" 14 | ) 15 | 16 | plt.show() 17 | 18 | sns.histplot( 19 | df, x="one" 20 | ) 21 | 22 | plt.show() 23 | 24 | 25 | plot() 26 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/matplotlib_data_dataframe_ax.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | fig, ax = plt.subplots() 10 | 11 | df = pd.DataFrame(np.array([[1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]), 12 | columns=['one', 'two']) 13 | 14 | ax.hist(x='one', data=df) 15 | plt.show() 16 | 17 | 18 | plot() 19 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/matplotlib_data_dataframe_plt.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]), 10 | columns=['one', 'two']) 11 | 12 | plt.hist(x='one', data=df) 13 | plt.show() 14 | 15 | 16 | plot() 17 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/matplotlib_x_array_ax.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | fig, ax = plt.subplots() 10 | 11 | ax.hist(np.array([1, 2, 3, 4, 5])) 12 | plt.show() 13 | 14 | 15 | plot() 16 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/matplotlib_x_array_plt.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | plt.hist(np.array([1, 2, 3, 4, 5])) 10 | plt.show() 11 | 12 | 13 | plot() 14 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/matplotlib_x_column_ax.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | fig, ax = plt.subplots() 10 | 11 | df = pd.DataFrame(np.array([[1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]), 12 | columns=['one', 'two']) 13 | 14 | ax.hist(df.one) 15 | plt.show() 16 | 17 | 18 | plot() 19 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/matplotlib_x_column_plt.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]), 10 | columns=['one', 'two']) 11 | 12 | plt.hist(df.one) 13 | plt.show() 14 | 15 | 16 | plot() 17 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/matplotlib_x_column_string_ax.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | fig, ax = plt.subplots() 10 | 11 | df = pd.DataFrame(np.array([[1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]), 12 | columns=['one', 'two']) 13 | 14 | ax.hist(df['one']) 15 | plt.show() 16 | 17 | 18 | plot() 19 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/matplotlib_x_column_string_plt.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]), 10 | columns=['one', 'two']) 11 | 12 | plt.hist(df['one']) 13 | plt.show() 14 | 15 | 16 | plot() 17 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/matplotlib_x_dataframe_ax.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | fig, ax = plt.subplots() 10 | 11 | df = pd.DataFrame(np.array([1, 2, 3, 4, 5]), 12 | columns=['one']) 13 | 14 | ax.hist(df) 15 | plt.show() 16 | 17 | 18 | plot() 19 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/matplotlib_x_dataframe_plt.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([1, 2, 3, 4, 5]), 10 | columns=['one']) 11 | 12 | plt.hist(df) 13 | plt.show() 14 | 15 | 16 | plot() 17 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/matplotlib_x_list_ax.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | fig, ax = plt.subplots() 10 | 11 | ax.hist([1, 2, 3, 4, 5]) 12 | plt.show() 13 | 14 | 15 | plot() 16 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/matplotlib_x_list_plt.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | plt.hist([1, 2, 3, 4, 5]) 10 | plt.show() 11 | 12 | 13 | plot() 14 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/matplotlib_x_series_ax.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | fig, ax = plt.subplots() 10 | 11 | ser = pd.Series(data=np.array([1, 2, 3, 4, 5])) 12 | 13 | ax.hist(ser) 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/matplotlib_x_series_plt.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | ser = pd.Series(data=np.array([1, 2, 3, 4, 5])) 10 | 11 | plt.hist(ser) 12 | plt.show() 13 | 14 | 15 | plot() 16 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/matplotlib_x_tuple_ax.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | fig, ax = plt.subplots() 10 | 11 | ax.hist((1, 2, 3, 4, 5)) 12 | plt.show() 13 | 14 | 15 | plot() 16 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/matplotlib_x_tuple_plt.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | plt.hist((1, 2, 3, 4, 5)) 10 | plt.show() 11 | 12 | 13 | plot() 14 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/pandas_column.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]), 10 | columns=['one', 'two']) 11 | 12 | df.one.hist() 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/pandas_column_plot.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]), 10 | columns=['one', 'two']) 11 | 12 | df.one.plot.hist() 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/pandas_column_plot_kind.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]), 10 | columns=['one', 'two']) 11 | 12 | df.one.plot(kind='hist') 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/pandas_column_string.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]), 10 | columns=['one', 'two']) 11 | 12 | df['one'].hist() 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/pandas_column_string_plot.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]), 10 | columns=['one', 'two']) 11 | 12 | df['one'].plot.hist() 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/pandas_column_string_plot_kind.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]), 10 | columns=['one', 'two']) 11 | 12 | df['one'].plot(kind='hist') 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/pandas_dataframe.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([1, 2, 3, 4, 5]), 10 | columns=['one']) 11 | 12 | df.hist() 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/pandas_dataframe_column.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]), 10 | columns=['one', 'two']) 11 | 12 | df.hist(column='one') 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/pandas_dataframe_plot.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([1, 2, 3, 4, 5]), 10 | columns=['one']) 11 | 12 | df.plot.hist() 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/pandas_dataframe_plot_column.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]), 10 | columns=['one', 'two']) 11 | 12 | df.plot.hist(column='one') 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/pandas_dataframe_plot_kind.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([1, 2, 3, 4, 5]), 10 | columns=['one']) 11 | 12 | df.plot(kind='hist') 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/pandas_dataframe_plot_kind_column.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]), 10 | columns=['one', 'two']) 11 | 12 | df.plot(column='one', kind='hist') 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/pandas_dataframe_plot_kind_x.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]), 10 | columns=['one', 'two']) 11 | 12 | df.plot(x='one', kind='hist') 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/pandas_dataframe_plot_kind_xy.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]), 10 | columns=['one', 'two']) 11 | 12 | df.plot(x='two', y='one', kind='hist') 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/pandas_dataframe_plot_kind_y.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]), 10 | columns=['one', 'two']) 11 | 12 | df.plot(y='one', kind='hist') 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/pandas_dataframe_plot_x.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]), 10 | columns=['one', 'two']) 11 | 12 | df.plot.hist(x='one') 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/pandas_dataframe_plot_xy.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]), 10 | columns=['one', 'two']) 11 | 12 | df.plot.hist(x='two', y='one') 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/pandas_dataframe_plot_y.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]), 10 | columns=['one', 'two']) 11 | 12 | df.plot.hist(y='one') 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/pandas_series.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | ser = pd.Series(data=np.array([1, 2, 3, 4, 5])) 10 | ser.hist() 11 | 12 | plt.show() 13 | 14 | 15 | plot() 16 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/pandas_series_plot.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | ser = pd.Series(data=np.array([1, 2, 3, 4, 5])) 10 | ser.plot.hist() 11 | 12 | plt.show() 13 | 14 | 15 | plot() 16 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/pandas_series_plot_kind.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | ser = pd.Series(data=np.array([1, 2, 3, 4, 5])) 10 | ser.plot(kind='hist') 11 | 12 | plt.show() 13 | 14 | 15 | plot() 16 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/seaborn_array.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import matplotlib.pyplot as plt 4 | import seaborn as sns 5 | import pandas as pd 6 | import numpy as np 7 | except ModuleNotFoundError: 8 | return 9 | 10 | sns.histplot(np.array([1, 2, 3, 4, 5]), bins=10) 11 | 12 | plt.show() 13 | 14 | 15 | plot() 16 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/seaborn_column.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import matplotlib.pyplot as plt 4 | import seaborn as sns 5 | import pandas as pd 6 | import numpy as np 7 | except ModuleNotFoundError: 8 | return 9 | 10 | df = pd.DataFrame(np.array([[1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]), 11 | columns=['one', 'two']) 12 | 13 | sns.histplot(df.one, bins=10) 14 | 15 | plt.show() 16 | 17 | 18 | plot() 19 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/seaborn_column_string.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import matplotlib.pyplot as plt 4 | import seaborn as sns 5 | import pandas as pd 6 | import numpy as np 7 | except ModuleNotFoundError: 8 | return 9 | 10 | df = pd.DataFrame(np.array([[1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]), 11 | columns=['one', 'two']) 12 | 13 | sns.histplot(df['one'], bins=10) 14 | 15 | plt.show() 16 | 17 | 18 | plot() 19 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/seaborn_dataframe.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import matplotlib.pyplot as plt 4 | import seaborn as sns 5 | import pandas as pd 6 | import numpy as np 7 | except ModuleNotFoundError: 8 | return 9 | 10 | df = pd.DataFrame(np.array([1, 2, 3, 4, 5]), columns=['one']) 11 | 12 | sns.histplot(df, bins=10) 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/seaborn_dataframe_x.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import matplotlib.pyplot as plt 4 | import seaborn as sns 5 | import pandas as pd 6 | import numpy as np 7 | except ModuleNotFoundError: 8 | return 9 | 10 | df = pd.DataFrame(np.array([[1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]), 11 | columns=['one', 'two']) 12 | 13 | sns.histplot(df, x='one', bins=10) 14 | 15 | plt.show() 16 | 17 | 18 | plot() 19 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/seaborn_dataframe_xy.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import matplotlib.pyplot as plt 4 | import seaborn as sns 5 | import pandas as pd 6 | import numpy as np 7 | except ModuleNotFoundError: 8 | return 9 | 10 | df = pd.DataFrame(np.array([[1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]), 11 | columns=['one', 'two']) 12 | 13 | sns.histplot(df, y='one', x='two', bins=10) 14 | 15 | plt.show() 16 | 17 | 18 | plot() 19 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/seaborn_dataframe_y.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import matplotlib.pyplot as plt 4 | import seaborn as sns 5 | import pandas as pd 6 | import numpy as np 7 | except ModuleNotFoundError: 8 | return 9 | 10 | df = pd.DataFrame(np.array([[1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]), 11 | columns=['one', 'two']) 12 | 13 | sns.histplot(df, y='one', bins=10) 14 | 15 | plt.show() 16 | 17 | 18 | plot() 19 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/seaborn_list.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import matplotlib.pyplot as plt 4 | import seaborn as sns 5 | import pandas as pd 6 | import numpy as np 7 | except ModuleNotFoundError: 8 | return 9 | 10 | sns.histplot([1, 2, 3, 4, 5], bins=10) 11 | 12 | plt.show() 13 | 14 | 15 | plot() 16 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/seaborn_series.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import matplotlib.pyplot as plt 4 | import seaborn as sns 5 | import pandas as pd 6 | import numpy as np 7 | except ModuleNotFoundError: 8 | return 9 | 10 | ser = pd.Series(data=np.array([1, 2, 3, 4, 5])) 11 | 12 | sns.histplot(ser, bins=10) 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_simple/seaborn_tuple.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import matplotlib.pyplot as plt 4 | import seaborn as sns 5 | import pandas as pd 6 | import numpy as np 7 | except ModuleNotFoundError: 8 | return 9 | 10 | sns.histplot((1, 2, 3, 4, 5), bins=10) 11 | 12 | plt.show() 13 | 14 | 15 | plot() 16 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_two_pics/matplotlib_x_arrays_ax.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | fig, ax = plt.subplots() 10 | 11 | ax.hist(np.array([[1, 2], [3, 4], [5, 6], [7, 8], [9, 10]])) 12 | plt.show() 13 | 14 | 15 | plot() 16 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_two_pics/matplotlib_x_arrays_plt.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | plt.hist(np.array([[1, 2], [3, 4], [5, 6], [7, 8], [9, 10]])) 10 | plt.show() 11 | 12 | 13 | plot() 14 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_two_pics/matplotlib_x_columns_ax.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | fig, ax = plt.subplots() 10 | 11 | df = pd.DataFrame(np.array([[1, 2], [3, 4], [5, 6], [7, 8], [9, 10]]), 12 | columns=['one', 'two']) 13 | 14 | ax.hist(df) 15 | plt.show() 16 | 17 | 18 | plot() 19 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_two_pics/matplotlib_x_columns_plt.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2], [3, 4], [5, 6], [7, 8], [9, 10]]), 10 | columns=['one', 'two']) 11 | 12 | plt.hist(df) 13 | plt.show() 14 | 15 | 16 | plot() 17 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_two_pics/matplotlib_x_lists_ax.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | fig, ax = plt.subplots() 10 | 11 | ax.hist([[1, 3, 5, 7, 9], [2, 4, 6, 8, 10]]) 12 | plt.show() 13 | 14 | 15 | plot() 16 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_two_pics/matplotlib_x_lists_plt.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | plt.hist([[1, 3, 5, 7, 9], [2, 4, 6, 8, 10]]) 10 | plt.show() 11 | 12 | 13 | plot() 14 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_two_pics/matplotlib_x_tuples_ax.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | fig, ax = plt.subplots() 10 | 11 | ax.hist(((1, 3, 5, 7, 9), (2, 4, 6, 8, 10))) 12 | plt.show() 13 | 14 | 15 | plot() 16 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_two_pics/matplotlib_x_tuples_plt.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | plt.hist(((1, 3, 5, 7, 9), (2, 4, 6, 8, 10))) 10 | plt.show() 11 | 12 | 13 | plot() 14 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_two_pics/pandas_column_hist_by.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 1], [2, 2], [3, 1], [4, 2], [5, 1], 10 | [6, 2], [7, 1], [8, 2], [9, 1], [10, 2], ]), 11 | columns=['one', 'two']) 12 | 13 | df.one.hist(by=df['two']) 14 | 15 | plt.show() 16 | 17 | 18 | plot() 19 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_two_pics/pandas_column_string_hist_by.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 1], [2, 2], [3, 1], [4, 2], [5, 1], 10 | [6, 2], [7, 1], [8, 2], [9, 1], [10, 2], ]), 11 | columns=['one', 'two']) 12 | 13 | df['one'].hist(by=df['two']) 14 | 15 | plt.show() 16 | 17 | 18 | plot() 19 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_two_pics/pandas_dataframe_hist.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2], [3, 4], [5, 6], [7, 8], [9, 10]]), 10 | columns=['one', 'two']) 11 | 12 | df.hist() 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_two_pics/pandas_dataframe_hist_by_dataframe.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 1], [2, 2], [3, 1], [4, 2], [5, 1], 10 | [6, 2], [7, 1], [8, 2], [9, 1], [10, 2], ]), 11 | columns=['one', 'two']) 12 | 13 | df.hist(column='one', by=df['two']) 14 | 15 | plt.show() 16 | 17 | 18 | plot() 19 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_two_pics/pandas_dataframe_hist_by_str.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 1], [2, 2], [3, 1], [4, 2], [5, 1], 10 | [6, 2], [7, 1], [8, 2], [9, 1], [10, 2], ]), 11 | columns=['one', 'two']) 12 | 13 | df.hist(column='one', by='two') 14 | 15 | plt.show() 16 | 17 | 18 | plot() 19 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_two_pics/pandas_dataframe_plot_hist.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2], [3, 4], [5, 6], [7, 8], [9, 10]]), 10 | columns=['one', 'two']) 11 | 12 | df.plot.hist() 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_two_pics/pandas_dataframe_plot_hist_by.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 1], [2, 2], [3, 1], [4, 2], [5, 1], 10 | [6, 2], [7, 1], [8, 2], [9, 1], [10, 2], ]), 11 | columns=['one', 'two']) 12 | 13 | df.plot.hist(column='one', by='two') 14 | 15 | plt.show() 16 | 17 | 18 | plot() 19 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_two_pics/pandas_dataframe_plot_kind_hist.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2], [3, 4], [5, 6], [7, 8], [9, 10]]), 10 | columns=['one', 'two']) 11 | 12 | df.plot(kind='hist') 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_two_pics/pandas_series_hist_by.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | ser = pd.Series(data=np.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])) 10 | by = pd.Series(data=np.array([1, 2, 1, 2, 1, 2, 1, 2, 1, 2])) 11 | 12 | ser.hist(by=by) 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_two_pics/seaborn_histplot_array.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import matplotlib.pyplot as plt 4 | import seaborn as sns 5 | import pandas as pd 6 | import numpy as np 7 | except ModuleNotFoundError: 8 | return 9 | 10 | sns.histplot(np.array([[1, 2], [3, 4], [5, 6], [7, 8], [9, 10]]), bins=10) 11 | 12 | plt.show() 13 | 14 | 15 | plot() 16 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_two_pics/seaborn_histplot_dataframe.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import matplotlib.pyplot as plt 4 | import seaborn as sns 5 | import pandas as pd 6 | import numpy as np 7 | except ModuleNotFoundError: 8 | return 9 | 10 | df = pd.DataFrame(np.array([[1, 2], [3, 4], [5, 6], [7, 8], [9, 10]]), 11 | columns=['one', 'two']) 12 | 13 | sns.histplot(df, bins=10) 14 | 15 | plt.show() 16 | 17 | 18 | plot() 19 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_two_pics/seaborn_histplot_list.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import matplotlib.pyplot as plt 4 | import seaborn as sns 5 | import pandas as pd 6 | import numpy as np 7 | except ModuleNotFoundError: 8 | return 9 | 10 | sns.histplot([[1, 3, 5, 7, 9], [2, 4, 6, 8, 10]], bins=10) 11 | 12 | plt.show() 13 | 14 | 15 | plot() 16 | -------------------------------------------------------------------------------- /tests/outcomes/plot/hist/universal_tests/data_two_pics/seaborn_histplot_tuple.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import matplotlib.pyplot as plt 4 | import seaborn as sns 5 | import pandas as pd 6 | import numpy as np 7 | except ModuleNotFoundError: 8 | return 9 | 10 | sns.histplot(((1, 3, 5, 7, 9), (2, 4, 6, 8, 10)), bins=10) 11 | 12 | plt.show() 13 | 14 | 15 | plot() 16 | -------------------------------------------------------------------------------- /tests/outcomes/plot/line/matplotlib/main.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | fig, ax = plt.subplots(figsize=(1, 2)) 10 | 11 | plt.plot([1, 2], [5, 8]) 12 | ax.plot([1, 2], [5, 8]) 13 | ax.plot([1, 5, 7, 8]) 14 | 15 | plt.show() 16 | 17 | 18 | plot() 19 | -------------------------------------------------------------------------------- /tests/outcomes/plot/line/pandas/main.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | s = pd.Series([1, 3, 2]) 10 | s.plot.line() 11 | s.plot(kind='line') 12 | 13 | df = pd.DataFrame({ 14 | 'a': [1, 3, 2], 15 | 'b': [1, 3, 2] 16 | }, index=[2, 4, 6]) 17 | df.plot.line() 18 | 19 | plt.show() 20 | 21 | 22 | plot() 23 | -------------------------------------------------------------------------------- /tests/outcomes/plot/line/seaborn/main.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import seaborn as sns 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame({ 10 | 'a': [1, 3, 2], 11 | 'b': [1, 3, 2] 12 | }, index=[2, 4, 6]) 13 | sns.lineplot(data=df, x="a", y="b") 14 | sns.lineplot(data=df) 15 | 16 | import matplotlib.pyplot as plt 17 | 18 | plt.show() 19 | 20 | 21 | plot() 22 | -------------------------------------------------------------------------------- /tests/outcomes/plot/lm/seaborn/main.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import matplotlib.pyplot as plt 4 | import seaborn as sns 5 | import pandas as pd 6 | import numpy as np 7 | except ModuleNotFoundError: 8 | return 9 | 10 | tips = sns.load_dataset("tips") 11 | g = sns.lmplot(x="total_bill", y="tip", data=tips) 12 | 13 | plt.show() 14 | 15 | 16 | plot() 17 | -------------------------------------------------------------------------------- /tests/outcomes/plot/lm/seaborn/test.py: -------------------------------------------------------------------------------- 1 | from hstest import TestedProgram 2 | from hstest.dynamic.dynamic_test import dynamic_test 3 | from hstest.stage import PlottingTest 4 | from hstest.testing.plotting.drawing.drawing_library import DrawingLibrary 5 | from tests.outcomes.plot.lm.test_lm_drawing import test_lm_drawing 6 | 7 | 8 | class TestSeabornLm(PlottingTest): 9 | @dynamic_test 10 | def test(self): 11 | program = TestedProgram() 12 | program.start() 13 | 14 | return test_lm_drawing(self.all_figures(), 1, DrawingLibrary.seaborn) 15 | -------------------------------------------------------------------------------- /tests/outcomes/plot/pie/universal_tests/data_no_label/matplotlib_y_array_ax.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | fig, ax = plt.subplots(figsize=(1, 2)) 10 | 11 | ax.pie([1, 2, 3]) 12 | 13 | plt.show() 14 | 15 | 16 | plot() 17 | -------------------------------------------------------------------------------- /tests/outcomes/plot/pie/universal_tests/data_no_label/matplotlib_y_array_plt.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | plt.pie([1, 2, 3]) 9 | 10 | plt.show() 11 | 12 | 13 | plot() 14 | -------------------------------------------------------------------------------- /tests/outcomes/plot/pie/universal_tests/data_no_label/matplotlib_y_nparray_ax.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | fig, ax = plt.subplots(figsize=(5, 5)) 10 | 11 | ax.pie(np.array([1, 2, 3])) 12 | 13 | plt.show() 14 | 15 | 16 | plot() 17 | -------------------------------------------------------------------------------- /tests/outcomes/plot/pie/universal_tests/data_no_label/matplotlib_y_nparray_plt.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | plt.pie(np.array([1, 2, 3])) 10 | 11 | plt.show() 12 | 13 | 14 | plot() 15 | -------------------------------------------------------------------------------- /tests/outcomes/plot/pie/universal_tests/data_no_label/matplotlib_y_tuple_ax.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | fig, ax = plt.subplots(figsize=(5, 5)) 10 | 11 | ax.pie((1, 2, 3)) 12 | 13 | plt.show() 14 | 15 | 16 | plot() 17 | -------------------------------------------------------------------------------- /tests/outcomes/plot/pie/universal_tests/data_no_label/matplotlib_y_tuple_plt.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | plt.pie((1, 2, 3)) 10 | 11 | plt.show() 12 | 13 | 14 | plot() 15 | -------------------------------------------------------------------------------- /tests/outcomes/plot/pie/universal_tests/data_simple/matplotlib_y_array_ax.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | fig, ax = plt.subplots(figsize=(1, 2)) 10 | 11 | ax.pie([1, 2, 3], labels=['Mercury', 'Venus', 'Earth']) 12 | 13 | plt.show() 14 | 15 | 16 | plot() 17 | -------------------------------------------------------------------------------- /tests/outcomes/plot/pie/universal_tests/data_simple/matplotlib_y_array_plt.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | plt.pie([1, 2, 3], labels=['Mercury', 'Venus', 'Earth']) 9 | 10 | plt.show() 11 | 12 | 13 | plot() 14 | -------------------------------------------------------------------------------- /tests/outcomes/plot/pie/universal_tests/data_simple/matplotlib_y_nparray_ax.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | fig, ax = plt.subplots(figsize=(5, 5)) 10 | 11 | ax.pie(np.array([1, 2, 3]), labels=['Mercury', 'Venus', 'Earth']) 12 | 13 | plt.show() 14 | 15 | 16 | plot() 17 | -------------------------------------------------------------------------------- /tests/outcomes/plot/pie/universal_tests/data_simple/matplotlib_y_nparray_plt.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | plt.pie(np.array([1, 2, 3]), labels=['Mercury', 'Venus', 'Earth']) 10 | 11 | plt.show() 12 | 13 | 14 | plot() 15 | -------------------------------------------------------------------------------- /tests/outcomes/plot/pie/universal_tests/data_simple/matplotlib_y_tuple_ax.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | fig, ax = plt.subplots(figsize=(5, 5)) 10 | 11 | ax.pie((1, 2, 3), labels=['Mercury', 'Venus', 'Earth']) 12 | 13 | plt.show() 14 | 15 | 16 | plot() 17 | -------------------------------------------------------------------------------- /tests/outcomes/plot/pie/universal_tests/data_simple/matplotlib_y_tuple_plt.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | plt.pie((1, 2, 3), labels=['Mercury', 'Venus', 'Earth']) 10 | 11 | plt.show() 12 | 13 | 14 | plot() 15 | -------------------------------------------------------------------------------- /tests/outcomes/plot/pie/universal_tests/data_simple/pandas_dataframe_plot_kind_y.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2, 3], [2, 3, 4], [3, 4, 5]]), 10 | columns=['one', 'two', 'three'], index=['Mercury', 'Venus', 'Earth']) 11 | 12 | df.plot(y='one', kind='pie') 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/pie/universal_tests/data_simple/pandas_dataframe_plot_y.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2, 3], [2, 3, 4], [3, 4, 5]]), 10 | columns=['one', 'two', 'three'], index=['Mercury', 'Venus', 'Earth']) 11 | 12 | df.plot.pie(y='one') 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/pie/universal_tests/data_simple/pandas_series_plot_kind_y.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | ser = pd.Series(data=np.array([1, 2, 3]), index=['Mercury', 'Venus', 'Earth']) 10 | ser.plot(kind='pie') 11 | 12 | plt.show() 13 | 14 | 15 | plot() 16 | -------------------------------------------------------------------------------- /tests/outcomes/plot/pie/universal_tests/data_simple/pandas_series_plot_y.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | ser = pd.Series(data=np.array([1, 2, 3]), index=['Mercury', 'Venus', 'Earth']) 10 | ser.plot.pie() 11 | 12 | plt.show() 13 | 14 | 15 | plot() 16 | -------------------------------------------------------------------------------- /tests/outcomes/plot/pie/universal_tests/data_two_pics/pandas_dataframe_plot.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2], [2, 3], [3, 4]]), 10 | columns=['one', 'two'], index=['Mercury', 'Venus', 'Earth']) 11 | 12 | df.plot.pie(subplots=True) 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/pie/universal_tests/data_two_pics/pandas_dataframe_plot_kind.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | df = pd.DataFrame(np.array([[1, 2], [2, 3], [3, 4]]), 10 | columns=['one', 'two'], index=['Mercury', 'Venus', 'Earth']) 11 | 12 | df.plot(kind='pie', subplots=True) 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/scatter/matplotlib/main.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import pandas as pd 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | except ModuleNotFoundError: 7 | return 8 | 9 | fig, ax = plt.subplots(figsize=(1, 2)) 10 | 11 | plt.scatter([1, 2], [2, 6]) 12 | ax.scatter([1, 2], [2, 6]) 13 | 14 | plt.show() 15 | 16 | 17 | plot() 18 | -------------------------------------------------------------------------------- /tests/outcomes/plot/violinplot/matplotlib/main.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import matplotlib.pyplot as plt 4 | import seaborn as sns 5 | import pandas as pd 6 | import numpy as np 7 | except ModuleNotFoundError: 8 | return 9 | 10 | fig, ax = plt.subplots() 11 | 12 | plt.violinplot([[1, 2, 4], 2, 1]) 13 | ax.violinplot([1, 2, 5]) 14 | 15 | plt.show() 16 | 17 | 18 | plot() 19 | -------------------------------------------------------------------------------- /tests/outcomes/plot/violinplot/seaborn/main.py: -------------------------------------------------------------------------------- 1 | def plot(): 2 | try: 3 | import matplotlib.pyplot as plt 4 | import seaborn as sns 5 | import pandas as pd 6 | import numpy as np 7 | except ModuleNotFoundError: 8 | return 9 | 10 | tips = sns.load_dataset("tips") 11 | ax = sns.violinplot(x=tips["total_bill"]) 12 | 13 | plt.show() 14 | 15 | 16 | plot() 17 | -------------------------------------------------------------------------------- /tests/outcomes/repeating/test_repeating/test.py: -------------------------------------------------------------------------------- 1 | from hstest.check_result import correct, wrong 2 | from hstest.dynamic.dynamic_test import dynamic_test 3 | from hstest.testing.unittest.user_error_test import UserErrorTest 4 | 5 | 6 | class TestRepeating(UserErrorTest): 7 | contain = "Wrong answer in test #6" 8 | 9 | @dynamic_test(repeat=5) 10 | def test(self): 11 | return correct() 12 | 13 | @dynamic_test 14 | def test2(self): 15 | return wrong('') 16 | -------------------------------------------------------------------------------- /tests/outcomes/repeating/test_repeating_2/test.py: -------------------------------------------------------------------------------- 1 | from hstest.check_result import correct, wrong 2 | from hstest.dynamic.dynamic_test import dynamic_test 3 | from hstest.testing.unittest.user_error_test import UserErrorTest 4 | 5 | 6 | class TestRepeating2(UserErrorTest): 7 | contain = "Wrong answer in test #6" 8 | 9 | @dynamic_test(repeat=5) 10 | def test(self): 11 | return correct() 12 | 13 | @dynamic_test() 14 | def test2(self): 15 | return wrong('') 16 | 17 | @dynamic_test(repeat=5) 18 | def test3(self): 19 | return correct() 20 | -------------------------------------------------------------------------------- /tests/outcomes/repeating/test_repeating_3/test.py: -------------------------------------------------------------------------------- 1 | from hstest.check_result import correct, wrong 2 | from hstest.dynamic.dynamic_test import dynamic_test 3 | from hstest.testing.unittest.user_error_test import UserErrorTest 4 | 5 | 6 | class TestRepeating3(UserErrorTest): 7 | contain = "Wrong answer in test #11" 8 | 9 | @dynamic_test(repeat=5) 10 | def test(self): 11 | return correct() 12 | 13 | @dynamic_test(repeat=5) 14 | def test3(self): 15 | return correct() 16 | 17 | @dynamic_test() 18 | def test2(self): 19 | return wrong('') 20 | -------------------------------------------------------------------------------- /tests/outcomes/repeating/test_repeating_wrong_amount/test.py: -------------------------------------------------------------------------------- 1 | from hstest.check_result import correct 2 | from hstest.dynamic.dynamic_test import dynamic_test 3 | from hstest.testing.unittest.unexepected_error_test import UnexpectedErrorTest 4 | 5 | 6 | class TestRepeatingWrongAmount(UnexpectedErrorTest): 7 | contain = "UnexpectedError: Dynamic test \"test\" should not be repeated < 0 times, found -1" 8 | 9 | @dynamic_test(repeat=-1) 10 | def test(self, x): 11 | return correct() 12 | -------------------------------------------------------------------------------- /tests/outcomes/runtime_exit/test_quit/main.py: -------------------------------------------------------------------------------- 1 | quit() 2 | -------------------------------------------------------------------------------- /tests/outcomes/runtime_exit/test_quit/test.py: -------------------------------------------------------------------------------- 1 | from typing import Any, List 2 | 3 | from hstest.check_result import CheckResult 4 | from hstest.test_case import TestCase 5 | from hstest.testing.unittest.user_error_test import UserErrorTest 6 | 7 | 8 | class TestQuit(UserErrorTest): 9 | contain = "Wrong answer in test #1" 10 | 11 | def generate(self) -> List[TestCase]: 12 | return [ 13 | TestCase() 14 | ] 15 | 16 | def check(self, reply: str, attach: Any) -> CheckResult: 17 | return CheckResult.wrong('') 18 | -------------------------------------------------------------------------------- /tests/outcomes/runtime_exit/unexpected_error_runtime_exit_in_check/main.py: -------------------------------------------------------------------------------- 1 | print(1) 2 | print(input()) 3 | -------------------------------------------------------------------------------- /tests/outcomes/runtime_exit/unexpected_error_runtime_exit_in_dynamic_input/main.py: -------------------------------------------------------------------------------- 1 | print(1) 2 | print(input()) 3 | -------------------------------------------------------------------------------- /tests/outcomes/runtime_exit/unexpected_error_runtime_exit_in_generate/main.py: -------------------------------------------------------------------------------- 1 | print(1) 2 | print(input()) 3 | -------------------------------------------------------------------------------- /tests/outcomes/search/go_files/go_files1/another.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | func main() { 8 | fmt.Println(`Starting to make a coffee 9 | Grinding coffee beans 10 | Boiling water 11 | Mixing boiled water with crushed coffee beans 12 | Pouring coffee into the cup 13 | Pouring some milk into the cup 14 | Coffee is ready!`) 15 | } 16 | -------------------------------------------------------------------------------- /tests/outcomes/search/go_files/go_files1/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | func main() { 8 | fmt.Println(`Starting to make a coffee 9 | Grinding coffee beans 10 | Boiling water 11 | Mixing boiled water with crushed coffee beans 12 | Pouring coffee into the cup 13 | Pouring some milk into the cup 14 | Coffee is ready!`) 15 | } 16 | -------------------------------------------------------------------------------- /tests/outcomes/search/go_files/go_files2/another.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | func test() { 8 | fmt.Println(`Starting to make a coffee 9 | Grinding coffee beans 10 | Boiling water 11 | Mixing boiled water with crushed coffee beans 12 | Pouring coffee into the cup 13 | Pouring some milk into the cup 14 | Coffee is ready!`) 15 | } 16 | -------------------------------------------------------------------------------- /tests/outcomes/search/go_files/go_files2/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | func main() { 8 | fmt.Println(`Starting to make a coffee 9 | Grinding coffee beans 10 | Boiling water 11 | Mixing boiled water with crushed coffee beans 12 | Pouring coffee into the cup 13 | Pouring some milk into the cup 14 | Coffee is ready!`) 15 | } 16 | -------------------------------------------------------------------------------- /tests/outcomes/search/go_files/go_files3/another.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | -------------------------------------------------------------------------------- /tests/outcomes/search/go_files/go_files3/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | -------------------------------------------------------------------------------- /tests/outcomes/separate_package/find_module_no_info/dir/main.py: -------------------------------------------------------------------------------- 1 | print("Module no info") 2 | -------------------------------------------------------------------------------- /tests/outcomes/separate_package/find_module_no_info/test.py: -------------------------------------------------------------------------------- 1 | from hstest.check_result import correct 2 | from hstest.dynamic.dynamic_test import dynamic_test 3 | from hstest.stage_test import StageTest 4 | from hstest.testing.tested_program import TestedProgram 5 | 6 | 7 | class FindModuleNoInfo(StageTest): 8 | @dynamic_test 9 | def test(self): 10 | main = TestedProgram() 11 | main.start() 12 | return correct() 13 | -------------------------------------------------------------------------------- /tests/outcomes/separate_package/find_module_no_info_analyze_imports/dir/main.py: -------------------------------------------------------------------------------- 1 | import main2 2 | print("Module no info") 3 | -------------------------------------------------------------------------------- /tests/outcomes/separate_package/find_module_no_info_analyze_imports/dir/main2.py: -------------------------------------------------------------------------------- 1 | import main3, main4 2 | print("Main 2") 3 | -------------------------------------------------------------------------------- /tests/outcomes/separate_package/find_module_no_info_analyze_imports/dir/main3.py: -------------------------------------------------------------------------------- 1 | print("Main 3") 2 | -------------------------------------------------------------------------------- /tests/outcomes/separate_package/find_module_no_info_analyze_imports/dir/main4.py: -------------------------------------------------------------------------------- 1 | print("Main 4") 2 | -------------------------------------------------------------------------------- /tests/outcomes/separate_package/find_module_no_info_analyze_imports_2/dir/main.py: -------------------------------------------------------------------------------- 1 | from main2 import x 2 | print(x) 3 | -------------------------------------------------------------------------------- /tests/outcomes/separate_package/find_module_no_info_analyze_imports_2/dir/main2.py: -------------------------------------------------------------------------------- 1 | import main3 2 | from main4 import x 3 | print("Main 2") 4 | -------------------------------------------------------------------------------- /tests/outcomes/separate_package/find_module_no_info_analyze_imports_2/dir/main3.py: -------------------------------------------------------------------------------- 1 | print("Main 3") 2 | -------------------------------------------------------------------------------- /tests/outcomes/separate_package/find_module_no_info_analyze_imports_2/dir/main4.py: -------------------------------------------------------------------------------- 1 | print("Main 4") 2 | x = "Module no info" 3 | -------------------------------------------------------------------------------- /tests/outcomes/separate_package/find_module_no_info_analyze_imports_3/dir/main.py: -------------------------------------------------------------------------------- 1 | from main2 import x 2 | print(x) 3 | -------------------------------------------------------------------------------- /tests/outcomes/separate_package/find_module_no_info_analyze_imports_3/dir/main2.py: -------------------------------------------------------------------------------- 1 | import main3 2 | print("Main 2") 3 | -------------------------------------------------------------------------------- /tests/outcomes/separate_package/find_module_no_info_analyze_imports_3/dir/main3.py: -------------------------------------------------------------------------------- 1 | print("Main 3") 2 | -------------------------------------------------------------------------------- /tests/outcomes/separate_package/find_module_no_info_analyze_imports_3/dir/main4.py: -------------------------------------------------------------------------------- 1 | print("Main 4") 2 | -------------------------------------------------------------------------------- /tests/outcomes/separate_package/find_module_no_info_analyze_name_main/dir/main.py: -------------------------------------------------------------------------------- 1 | import main2 2 | 3 | if __name__ == '__main__': 4 | pass 5 | -------------------------------------------------------------------------------- /tests/outcomes/separate_package/find_module_no_info_analyze_name_main/dir/main2.py: -------------------------------------------------------------------------------- 1 | import main3 2 | print("Main 2") 3 | -------------------------------------------------------------------------------- /tests/outcomes/separate_package/find_module_no_info_analyze_name_main/dir/main3.py: -------------------------------------------------------------------------------- 1 | print("Main 3") 2 | -------------------------------------------------------------------------------- /tests/outcomes/separate_package/find_module_no_info_analyze_name_main/dir/main4.py: -------------------------------------------------------------------------------- 1 | print("Main 4") 2 | -------------------------------------------------------------------------------- /tests/outcomes/separate_package/find_module_no_info_analyze_name_main/test.py: -------------------------------------------------------------------------------- 1 | from hstest.check_result import CheckResult 2 | from hstest.dynamic.dynamic_test import dynamic_test 3 | from hstest.stage_test import StageTest 4 | from hstest.testing.tested_program import TestedProgram 5 | 6 | 7 | class FindModuleNoInfoAnalyzeImports(StageTest): 8 | @dynamic_test 9 | def test(self): 10 | main = TestedProgram() 11 | result = main.start() 12 | return CheckResult( 13 | result == 14 | 'Main 3\n' 15 | 'Main 2\n', '') 16 | -------------------------------------------------------------------------------- /tests/outcomes/separate_package/find_module_no_info_analyze_name_main_2/dir/main.py: -------------------------------------------------------------------------------- 1 | import main2 2 | 3 | if __name__ == "__main__": 4 | pass 5 | -------------------------------------------------------------------------------- /tests/outcomes/separate_package/find_module_no_info_analyze_name_main_2/dir/main2.py: -------------------------------------------------------------------------------- 1 | import main3 2 | print("Main 2") 3 | -------------------------------------------------------------------------------- /tests/outcomes/separate_package/find_module_no_info_analyze_name_main_2/dir/main3.py: -------------------------------------------------------------------------------- 1 | print("Main 3") 2 | -------------------------------------------------------------------------------- /tests/outcomes/separate_package/find_module_no_info_analyze_name_main_2/dir/main4.py: -------------------------------------------------------------------------------- 1 | print("Main 4") 2 | -------------------------------------------------------------------------------- /tests/outcomes/separate_package/find_module_no_info_analyze_name_main_2/test.py: -------------------------------------------------------------------------------- 1 | from hstest.check_result import CheckResult 2 | from hstest.dynamic.dynamic_test import dynamic_test 3 | from hstest.stage_test import StageTest 4 | from hstest.testing.tested_program import TestedProgram 5 | 6 | 7 | class FindModuleNoInfoAnalyzeImports(StageTest): 8 | @dynamic_test 9 | def test(self): 10 | main = TestedProgram() 11 | result = main.start() 12 | return CheckResult( 13 | result == 14 | 'Main 3\n' 15 | 'Main 2\n', '') 16 | -------------------------------------------------------------------------------- /tests/outcomes/separate_package/find_module_no_info_analyze_name_main_3/dir/main.py: -------------------------------------------------------------------------------- 1 | import main2 2 | 3 | if __name__ == "__main__": 4 | pass 5 | -------------------------------------------------------------------------------- /tests/outcomes/separate_package/find_module_no_info_analyze_name_main_3/dir/main2.py: -------------------------------------------------------------------------------- 1 | import main3 2 | print("Main 2") 3 | -------------------------------------------------------------------------------- /tests/outcomes/separate_package/find_module_no_info_analyze_name_main_3/dir/main3.py: -------------------------------------------------------------------------------- 1 | print("Main 3") 2 | -------------------------------------------------------------------------------- /tests/outcomes/separate_package/find_module_no_info_analyze_name_main_3/dir/main4.py: -------------------------------------------------------------------------------- 1 | print("Main 4") 2 | 3 | if __name__ == "__main__": 4 | pass 5 | -------------------------------------------------------------------------------- /tests/outcomes/separate_package/find_module_no_info_analyze_name_main_4/dir/main.py: -------------------------------------------------------------------------------- 1 | import main2 2 | 3 | if __name__ == "__main__": 4 | pass 5 | -------------------------------------------------------------------------------- /tests/outcomes/separate_package/find_module_no_info_analyze_name_main_4/dir/main2.py: -------------------------------------------------------------------------------- 1 | import main3 2 | print("Main 2") 3 | -------------------------------------------------------------------------------- /tests/outcomes/separate_package/find_module_no_info_analyze_name_main_4/dir/main3.py: -------------------------------------------------------------------------------- 1 | import main4 2 | print("Main 3") 3 | -------------------------------------------------------------------------------- /tests/outcomes/separate_package/find_module_no_info_analyze_name_main_4/dir/main4.py: -------------------------------------------------------------------------------- 1 | print("Main 4") 2 | 3 | if __name__ == "__main__": 4 | pass 5 | -------------------------------------------------------------------------------- /tests/outcomes/simple_test/test_simple_test_case/main.py: -------------------------------------------------------------------------------- 1 | n = input() 2 | print(n) 3 | print(n) 4 | -------------------------------------------------------------------------------- /tests/outcomes/simple_test/test_simple_test_case/test.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | 3 | from hstest.stage_test import StageTest 4 | from hstest.test_case import SimpleTestCase, TestCase 5 | 6 | 7 | class TesSimpleTestCase(StageTest): 8 | 9 | def generate(self) -> List[TestCase]: 10 | return [ 11 | SimpleTestCase(stdin="123", stdout="123\n123", feedback=''), 12 | SimpleTestCase(stdin="567", stdout="567\n567", feedback='') 13 | ] 14 | -------------------------------------------------------------------------------- /tests/outcomes/simple_test/test_simple_test_case_fail/main.py: -------------------------------------------------------------------------------- 1 | n = input() 2 | print(n) 3 | -------------------------------------------------------------------------------- /tests/outcomes/stderr/disable_catching_stderr/main.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | print('text from stderr', file=sys.stderr) 4 | -------------------------------------------------------------------------------- /tests/outcomes/stderr/dynamically_change_stderr_catching/main.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | print('text from stderr', file=sys.stderr) 4 | -------------------------------------------------------------------------------- /tests/outcomes/stderr_on_unexpected_error/with_args/test_output_with_stderr_and_with_stdout/main.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | for _ in range(3): 4 | print("User stderr output!", file=sys.stderr) 5 | 6 | for _ in range(3): 7 | print("User stdout output!") 8 | -------------------------------------------------------------------------------- /tests/outcomes/stderr_on_unexpected_error/with_args/test_output_with_stdout_and_without_stderr/main.py: -------------------------------------------------------------------------------- 1 | for _ in range(3): 2 | print("User stdout output!") 3 | -------------------------------------------------------------------------------- /tests/outcomes/stderr_on_unexpected_error/with_args/test_output_without_stderr_and_without_stdout/main.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperskill/hs-test-python/0339e9ac29cce939d994b8c4ed85a6daa41d4306/tests/outcomes/stderr_on_unexpected_error/with_args/test_output_without_stderr_and_without_stdout/main.py -------------------------------------------------------------------------------- /tests/outcomes/stderr_on_unexpected_error/with_args/test_output_without_stdout_and_with_stderr/main.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | for _ in range(3): 4 | print("User stderr output!", file=sys.stderr) 5 | -------------------------------------------------------------------------------- /tests/outcomes/stderr_on_unexpected_error/without_args/test_output_with_stderr_and_with_stdout/main.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | for _ in range(3): 4 | print("User stderr output!", file=sys.stderr) 5 | 6 | for _ in range(3): 7 | print("User stdout output!") 8 | -------------------------------------------------------------------------------- /tests/outcomes/stderr_on_unexpected_error/without_args/test_output_with_stdout_and_without_stderr/main.py: -------------------------------------------------------------------------------- 1 | for _ in range(3): 2 | print("User stdout output!") 3 | -------------------------------------------------------------------------------- /tests/outcomes/stderr_on_unexpected_error/without_args/test_output_without_stderr_and_without_stdout/main.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperskill/hs-test-python/0339e9ac29cce939d994b8c4ed85a6daa41d4306/tests/outcomes/stderr_on_unexpected_error/without_args/test_output_without_stderr_and_without_stdout/main.py -------------------------------------------------------------------------------- /tests/outcomes/stderr_on_unexpected_error/without_args/test_output_without_stdout_and_with_stderr/main.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | for _ in range(3): 4 | print("User stderr output!", file=sys.stderr) 5 | -------------------------------------------------------------------------------- /tests/outcomes/syntax_error/test_empty_eval/main.py: -------------------------------------------------------------------------------- 1 | print(eval("")) 2 | -------------------------------------------------------------------------------- /tests/outcomes/syntax_error/test_error_using_eval/main.py: -------------------------------------------------------------------------------- 1 | print(eval(")")) 2 | -------------------------------------------------------------------------------- /tests/outcomes/syntax_error/test_error_using_eval_and_print/main.py: -------------------------------------------------------------------------------- 1 | print("123") 2 | print(eval(")")) 3 | -------------------------------------------------------------------------------- /tests/outcomes/syntax_error/test_error_using_exec/main.py: -------------------------------------------------------------------------------- 1 | exec("print)") 2 | -------------------------------------------------------------------------------- /tests/outcomes/syntax_error/test_syntax_error_1/main.py: -------------------------------------------------------------------------------- 1 | print) 2 | -------------------------------------------------------------------------------- /tests/outcomes/syntax_error/test_syntax_error_1/test.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | 3 | from hstest.test_case import TestCase 4 | from hstest.testing.unittest.user_error_test import UserErrorTest 5 | 6 | 7 | class TestSyntaxError1(UserErrorTest): 8 | contain = """ 9 | Exception in test #1 10 | 11 | Traceback (most recent call last): 12 | File "main.py", line 1 13 | print) 14 | ^ 15 | SyntaxError: 16 | """ # noqa: W291 17 | 18 | def generate(self) -> List[TestCase]: 19 | return [ 20 | TestCase() 21 | ] 22 | -------------------------------------------------------------------------------- /tests/outcomes/syntax_error/test_syntax_error_2/main.py: -------------------------------------------------------------------------------- 1 | print(12 23) 2 | -------------------------------------------------------------------------------- /tests/outcomes/test_passed_thrown/test_passed_thrown_in_check_1/main.py: -------------------------------------------------------------------------------- 1 | print("Hello, World!") 2 | -------------------------------------------------------------------------------- /tests/outcomes/test_passed_thrown/test_passed_thrown_in_check_2/main.py: -------------------------------------------------------------------------------- 1 | print("Hello, World!") 2 | -------------------------------------------------------------------------------- /tests/outcomes/test_passed_thrown/test_passed_thrown_in_dynamic_input_1/main.py: -------------------------------------------------------------------------------- 1 | print("1", end='') 2 | input() 3 | -------------------------------------------------------------------------------- /tests/outcomes/test_passed_thrown/test_passed_thrown_in_dynamic_input_2/main.py: -------------------------------------------------------------------------------- 1 | print("2", end='') 2 | input() 3 | -------------------------------------------------------------------------------- /tests/outcomes/timeout/test_default_time_limit/main.py: -------------------------------------------------------------------------------- 1 | from time import sleep 2 | sleep(16) 3 | -------------------------------------------------------------------------------- /tests/outcomes/timeout/test_no_time_limit/main.py: -------------------------------------------------------------------------------- 1 | from time import sleep 2 | sleep(16) 3 | -------------------------------------------------------------------------------- /tests/outcomes/timeout/test_no_time_limit/test.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from typing import Any, List 3 | 4 | from hstest.check_result import CheckResult 5 | from hstest.stage_test import StageTest 6 | from hstest.test_case import TestCase 7 | 8 | 9 | @unittest.skip('takes too long') 10 | class TestNoTimeLimit(StageTest): 11 | 12 | def generate(self) -> List[TestCase]: 13 | return [ 14 | TestCase(time_limit=-1), 15 | ] 16 | 17 | def check(self, reply: str, attach: Any) -> CheckResult: 18 | return CheckResult.correct() 19 | -------------------------------------------------------------------------------- /tests/outcomes/timeout/test_timeout_1/main.py: -------------------------------------------------------------------------------- 1 | from time import sleep 2 | sleep(int(input()) / 1000) 3 | -------------------------------------------------------------------------------- /tests/outcomes/timeout/test_timeout_2/main.py: -------------------------------------------------------------------------------- 1 | from time import sleep 2 | sleep(int(input()) / 1000) 3 | -------------------------------------------------------------------------------- /tests/outcomes/timeout/test_timeout_3/main.py: -------------------------------------------------------------------------------- 1 | while True: 2 | pass 3 | -------------------------------------------------------------------------------- /tests/outcomes/unexpected_error/unexpected_error_add_input_1/main.py: -------------------------------------------------------------------------------- 1 | print(input()) 2 | -------------------------------------------------------------------------------- /tests/outcomes/unexpected_error/unexpected_error_add_input_2/main.py: -------------------------------------------------------------------------------- 1 | print(input()) 2 | -------------------------------------------------------------------------------- /tests/outcomes/unexpected_error/unexpected_error_add_input_3/main.py: -------------------------------------------------------------------------------- 1 | print(1) 2 | print(input()) 3 | -------------------------------------------------------------------------------- /tests/outcomes/unexpected_error/unexpected_error_during_checking/main.py: -------------------------------------------------------------------------------- 1 | print('Hello World') 2 | -------------------------------------------------------------------------------- /tests/outcomes/unexpected_error/unexpected_error_during_checking_with_assertion/main.py: -------------------------------------------------------------------------------- 1 | print('Hello World') 2 | -------------------------------------------------------------------------------- /tests/outcomes/unexpected_error/unexpected_error_empty_test_cases/main.py: -------------------------------------------------------------------------------- 1 | print('Hello World') 2 | -------------------------------------------------------------------------------- /tests/outcomes/unexpected_error/unexpected_error_generating_tests/main.py: -------------------------------------------------------------------------------- 1 | print('Hello World') 2 | -------------------------------------------------------------------------------- /tests/outcomes/unexpected_error/unexpected_error_generating_tests_with_assertion/main.py: -------------------------------------------------------------------------------- 1 | print('Hello World') 2 | -------------------------------------------------------------------------------- /tests/outcomes/unexpected_error/unexpected_error_no_check_method/main.py: -------------------------------------------------------------------------------- 1 | print('Hello World') 2 | -------------------------------------------------------------------------------- /tests/outcomes/unexpected_error/unexpected_error_not_generating_tests/main.py: -------------------------------------------------------------------------------- 1 | print('Hello World') 2 | -------------------------------------------------------------------------------- /tests/outcomes/wrong_answer/wrong_answer_dynamic_input_1/main.py: -------------------------------------------------------------------------------- 1 | print('1') 2 | input() 3 | -------------------------------------------------------------------------------- /tests/outcomes/wrong_answer/wrong_answer_dynamic_input_2/main.py: -------------------------------------------------------------------------------- 1 | print('1') 2 | print(input()) 3 | -------------------------------------------------------------------------------- /tests/outcomes/wrong_answer/wrong_answer_dynamic_input_3/main.py: -------------------------------------------------------------------------------- 1 | print(input()) 2 | print(input()) 3 | print(input()) 4 | -------------------------------------------------------------------------------- /tests/outcomes/wrong_answer/wrong_answer_dynamic_input_4/main.py: -------------------------------------------------------------------------------- 1 | print(input()) 2 | print(input()) 3 | print(input()) 4 | -------------------------------------------------------------------------------- /tests/outcomes/wrong_answer/wrong_answer_in_test_1/main.py: -------------------------------------------------------------------------------- 1 | print("Hello, World!") 2 | -------------------------------------------------------------------------------- /tests/outcomes/wrong_answer/wrong_answer_in_test_1/test.py: -------------------------------------------------------------------------------- 1 | from typing import Any, List 2 | 3 | from hstest.check_result import CheckResult 4 | from hstest.test_case import TestCase 5 | from hstest.testing.unittest.user_error_test import UserErrorTest 6 | 7 | 8 | class WrongAnswerInTest1(UserErrorTest): 9 | contain = "Wrong answer in test #1" 10 | 11 | def generate(self) -> List[TestCase]: 12 | return [ 13 | TestCase() 14 | ] 15 | 16 | def check(self, reply: str, attach: Any) -> CheckResult: 17 | return CheckResult(False, '') 18 | -------------------------------------------------------------------------------- /tests/outcomes/wrong_answer/wrong_answer_in_test_2/main.py: -------------------------------------------------------------------------------- 1 | print("Hello, World!") 2 | -------------------------------------------------------------------------------- /tests/outcomes/wrong_answer_thrown/wrong_answer_thrown_in_check_1/main.py: -------------------------------------------------------------------------------- 1 | print("Hello, World!") 2 | -------------------------------------------------------------------------------- /tests/outcomes/wrong_answer_thrown/wrong_answer_thrown_in_check_2/main.py: -------------------------------------------------------------------------------- 1 | print("Hello, World!") 2 | -------------------------------------------------------------------------------- /tests/outcomes/wrong_answer_thrown/wrong_answer_thrown_in_dynamic_input_1/main.py: -------------------------------------------------------------------------------- 1 | print("1", end='') 2 | input() 3 | -------------------------------------------------------------------------------- /tests/outcomes/wrong_answer_thrown/wrong_answer_thrown_in_dynamic_input_2/main.py: -------------------------------------------------------------------------------- 1 | print("2", end='') 2 | input() 3 | -------------------------------------------------------------------------------- /tests/projects/go/coffee_machine/stage1/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | func main() { 8 | fmt.Println(`Starting to make a coffee 9 | Grinding coffee beans 10 | Boiling water 11 | Mixing boiled water with crushed coffee beans 12 | Pouring coffee into the cup 13 | Pouring some milk into the cup 14 | Coffee is ready!`) 15 | } 16 | -------------------------------------------------------------------------------- /tests/projects/go/coffee_machine/stage1_ce/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | func main() { 8 | Println(`12123123`) 9 | } 10 | -------------------------------------------------------------------------------- /tests/projects/go/coffee_machine/stage1_ex/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | func main() { 4 | panic("unreachable") 5 | } 6 | -------------------------------------------------------------------------------- /tests/projects/go/coffee_machine/stage1_wa/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | func main() { 8 | fmt.Println(`12123123`) 9 | } 10 | -------------------------------------------------------------------------------- /tests/projects/go/coffee_machine/stage2/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | func main() { 8 | var cups int 9 | fmt.Print("Write how many cups of coffee you will need: ") 10 | fmt.Scanf("%d\n", &cups) 11 | fmt.Printf(`For %d cups of coffee you will need: 12 | %d ml of water 13 | %d ml of milk 14 | %d g of coffee beans`, cups, cups*200, cups*50, cups*15) 15 | } 16 | -------------------------------------------------------------------------------- /tests/projects/javascript/coffee_machine/stage1/main.js: -------------------------------------------------------------------------------- 1 | 2 | console.log(`Starting to make a coffee 3 | Grinding coffee beans 4 | Boiling water 5 | Mixing boiled water with crushed coffee beans 6 | Pouring coffee into the cup 7 | Pouring some milk into the cup 8 | Coffee is ready!`) 9 | -------------------------------------------------------------------------------- /tests/projects/javascript/coffee_machine/stage1_ce/main.js: -------------------------------------------------------------------------------- 1 | 2 | console.log(`Starting to make a coffee 3 | Grinding coffee beans 4 | Boiling water 5 | Mixing boiled water with crushed coffee beans 6 | Pouring coffee into the cup 7 | Pouring some milk into the cup 8 | Coffee is ready!` 9 | -------------------------------------------------------------------------------- /tests/projects/javascript/coffee_machine/stage1_ex/main.js: -------------------------------------------------------------------------------- 1 | 2 | console.log(0 .valueOf1()) 3 | -------------------------------------------------------------------------------- /tests/projects/javascript/coffee_machine/stage1_wa/main.js: -------------------------------------------------------------------------------- 1 | console.log('12123123') 2 | -------------------------------------------------------------------------------- /tests/projects/javascript/coffee_machine/stage2/main.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | const input = require('sync-input') 5 | 6 | cups = Number(input("Write how many cups of coffee you will need: ")) 7 | console.log('For ' + cups + " cups of coffee you will need:") 8 | console.log(cups*200 + " ml of water") 9 | console.log(cups*50 + " ml of milk") 10 | console.log(cups*15 + " g of coffee beans") 11 | -------------------------------------------------------------------------------- /tests/projects/javascript/simple_chatty_bot/stage1/main.js: -------------------------------------------------------------------------------- 1 | let botName = "Monthy"; 2 | let birthYear = "2020"; 3 | 4 | console.log(`Hello! My name is ${botName}. 5 | I was created in ${birthYear}.`); 6 | -------------------------------------------------------------------------------- /tests/projects/javascript/simple_chatty_bot/stage2/main.js: -------------------------------------------------------------------------------- 1 | const input = require('sync-input'); 2 | 3 | let botName = "Aid"; 4 | let birthYear = "2020"; 5 | 6 | console.log(`Hello! My name is ${botName}. 7 | I was created in ${birthYear}.`); 8 | 9 | let userName = input("Please, remind me your name.\n"); 10 | 11 | console.log(`What a great name you have, ${userName}!`); 12 | 13 | -------------------------------------------------------------------------------- /tests/projects/javascript/zookeeper/stage1/main.js: -------------------------------------------------------------------------------- 1 | console.log( 2 | "I love animals!\n"+ 3 | "Let's check on the animals...\n"+ 4 | "The deer looks fine.\n"+ 5 | "The bat looks happy.\n"+ 6 | "The lion looks healthy." 7 | ); 8 | -------------------------------------------------------------------------------- /tests/projects/python/coffee_machine/stage1/machine/coffee_machine.py: -------------------------------------------------------------------------------- 1 | # Write your code here 2 | print("""Starting to make a coffee 3 | Grinding coffee beans 4 | Boiling water 5 | Mixing boiled water with crushed coffee beans 6 | Pouring coffee into the cup 7 | Pouring some milk into the cup 8 | Coffee is ready!""") 9 | -------------------------------------------------------------------------------- /tests/projects/shell/coffee_machine/stage1/main.sh: -------------------------------------------------------------------------------- 1 | echo Starting to make a coffee 2 | echo Grinding coffee beans 3 | echo Boiling water 4 | echo Mixing boiled water with crushed coffee beans 5 | echo Pouring coffee into the cup 6 | echo Pouring some milk into the cup 7 | echo Coffee is ready! -------------------------------------------------------------------------------- /tests/projects/shell/coffee_machine/stage1_ex/main.sh: -------------------------------------------------------------------------------- 1 | ech -------------------------------------------------------------------------------- /tests/projects/shell/coffee_machine/stage1_wa/main.sh: -------------------------------------------------------------------------------- 1 | echo 12123123 2 | -------------------------------------------------------------------------------- /tests/projects/shell/coffee_machine/stage2/main.sh: -------------------------------------------------------------------------------- 1 | echo Write how many cups of coffee you will need: 2 | read -r cups 3 | echo "For $cups cups of coffee you will need:" 4 | echo "$((cups * 200)) ml of water" 5 | echo "$((cups * 50)) ml of milk" 6 | echo "$((cups * 15)) g of coffee beans" 7 | -------------------------------------------------------------------------------- /tests/sql/test_db_connection/sqlite/main.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperskill/hs-test-python/0339e9ac29cce939d994b8c4ed85a6daa41d4306/tests/sql/test_db_connection/sqlite/main.sql -------------------------------------------------------------------------------- /tests/sql/test_db_connection/sqlite/test.py: -------------------------------------------------------------------------------- 1 | from sqlite3 import Connection 2 | 3 | from hstest import correct, dynamic_test, SQLTest, wrong 4 | 5 | 6 | class TestSQLProject(SQLTest): 7 | @dynamic_test 8 | def test_queries(self): 9 | if type(self.db) is not Connection: 10 | return wrong('SQLite should be used by default') 11 | 12 | return correct() 13 | -------------------------------------------------------------------------------- /tests/sql/test_parsing_sql_files/parsing1/main.sql: -------------------------------------------------------------------------------- 1 | create_table 2 | = "CREATE TABLE STUDENT( 3 | ID INT PRIMARY KEY NOT NULL, 4 | NAME CHAR(20) NOT NULL, 5 | ROLL CHAR(20), 6 | ADDRESS CHAR(50), 7 | CLASS CHAR(20) )"; 8 | 9 | test 10 | = "UPDATE Customers 11 | SET ContactName = 'Alfred Schmidt', City= 'Frankfurt' 12 | WHERE CustomerID = 1"; 13 | 14 | -------------------------------------------------------------------------------- /tests/sql/test_queries/execute/test_execute_query_name_with_wrong_query/main.sql: -------------------------------------------------------------------------------- 1 | create_table = "CRE TABLE contacts ( 2 | contact_id INTEGER PRIMARY KEY, 3 | first_name TEXT NOT NULL, 4 | last_name TEXT NOT NULL, 5 | email TEXT NOT NULL UNIQUE, 6 | phone TEXT NOT NULL UNIQUE 7 | );" 8 | 9 | insert_data = "INSERT INTO contacts VALUES(1, 'first_name', 'last_name', 'email', 'phone');" -------------------------------------------------------------------------------- /tests/sql/test_queries/execute/test_execute_with_plain_query/main.sql: -------------------------------------------------------------------------------- 1 | create_table = "CREATE TABLE contacts ( 2 | contact_id INTEGER PRIMARY KEY, 3 | first_name TEXT NOT NULL, 4 | last_name TEXT NOT NULL, 5 | email TEXT NOT NULL UNIQUE, 6 | phone TEXT NOT NULL UNIQUE 7 | );" -------------------------------------------------------------------------------- /tests/sql/test_queries/execute/test_execute_with_query_name/main.sql: -------------------------------------------------------------------------------- 1 | create_table = "CREATE TABLE contacts ( 2 | contact_id INTEGER PRIMARY KEY, 3 | first_name TEXT NOT NULL, 4 | last_name TEXT NOT NULL, 5 | email TEXT NOT NULL UNIQUE, 6 | phone TEXT NOT NULL UNIQUE 7 | );" -------------------------------------------------------------------------------- /tests/sql/test_queries/execute/test_execute_with_wrong_plain_query/main.sql: -------------------------------------------------------------------------------- 1 | create_table = "CREATE TABLE contacts ( 2 | contact_id INTEGER PRIMARY KEY, 3 | first_name TEXT NOT NULL, 4 | last_name TEXT NOT NULL, 5 | email TEXT NOT NULL UNIQUE, 6 | phone TEXT NOT NULL UNIQUE 7 | );" -------------------------------------------------------------------------------- /tests/sql/test_queries/sqlite/create_table/main.sql: -------------------------------------------------------------------------------- 1 | create_table = "CREATE TABLE contacts ( 2 | contact_id INTEGER PRIMARY KEY, 3 | first_name TEXT NOT NULL, 4 | last_name TEXT NOT NULL, 5 | email TEXT NOT NULL UNIQUE, 6 | phone TEXT NOT NULL UNIQUE 7 | );" -------------------------------------------------------------------------------- /tests/sql/test_queries/sqlite/insert_and_select_data/main.sql: -------------------------------------------------------------------------------- 1 | create_table = "CREATE TABLE contacts ( 2 | contact_id INTEGER PRIMARY KEY, 3 | first_name TEXT NOT NULL, 4 | last_name TEXT NOT NULL, 5 | email TEXT NOT NULL UNIQUE, 6 | phone TEXT NOT NULL UNIQUE 7 | );" 8 | 9 | insert_data = "INSERT INTO contacts VALUES(1, 'first_name', 'last_name', 'email', 'phone');" -------------------------------------------------------------------------------- /tests/test_check_result.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import unittest 4 | 5 | from hstest.check_result import CheckResult 6 | 7 | 8 | class TestCheckResult(unittest.TestCase): 9 | def test_true(self) -> None: 10 | r = CheckResult.correct() 11 | self.assertTrue(r.is_correct) 12 | self.assertEqual(r.feedback, "") 13 | 14 | def test_false(self) -> None: 15 | r = CheckResult.wrong("hello") 16 | self.assertFalse(r.is_correct) 17 | self.assertEqual(r.feedback, "hello") 18 | --------------------------------------------------------------------------------