diff --git a/python/spec/dependabot/python/file_parser/setup_file_parser_spec.rb b/python/spec/dependabot/python/file_parser/setup_file_parser_spec.rb index ce744859d05..ff3690a102a 100644 --- a/python/spec/dependabot/python/file_parser/setup_file_parser_spec.rb +++ b/python/spec/dependabot/python/file_parser/setup_file_parser_spec.rb @@ -255,19 +255,19 @@ its(:length) { is_expected.to eq(12) } end - # context "with an illformed_requirement" do - # let(:setup_cfg_file_fixture_name) { "illformed_req.cfg" } - - # it "raises a helpful error" do - # expect { parser.dependency_set } - # .to raise_error do |error| - # expect(error.class) - # .to eq(Dependabot::DependencyFileNotEvaluatable) - # expect(error.message) - # .to include("InstallationError(\"Invalid requirement: 'psycopg2==2.6.1raven == 5.32.0'\")") - # end - # end - # end + context "with an illformed_requirement" do + let(:setup_cfg_file_fixture_name) { "illformed_req.cfg" } + + it "raises a helpful error" do + expect { parser.dependency_set } + .to raise_error do |error| + expect(error.class) + .to eq(Dependabot::DependencyFileNotEvaluatable) + expect(error.message) + .to include("InstallationError(\"Invalid requirement: 'psycopg2==2.6.1raven == 5.32.0': Expected end or semicolon (after version specifier)\\n psycopg2==2.6.1raven == 5.32.0\\n ~~~~~~~~^\")") # rubocop:disable Layout/LineLength + end + end + end context "with comments in the setup.cfg file" do subject(:dependency) { dependencies.find { |d| d.name == "boto3" } } diff --git a/python/spec/fixtures/setup_files/setup.cfg b/python/spec/fixtures/setup_files/setup.cfg index 711240c7acd..b3328ca4e30 100644 --- a/python/spec/fixtures/setup_files/setup.cfg +++ b/python/spec/fixtures/setup_files/setup.cfg @@ -19,7 +19,6 @@ classifiers = Programming Language :: Python :: 3.5 Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 Operating System :: POSIX Operating System :: Unix Operating System :: MacOS