Skip to content

Commit

Permalink
Get the python code to snitch it's version
Browse files Browse the repository at this point in the history
Ensure there's evidence of the Python version that is embedded in the
perl extension
  • Loading branch information
foursixnine committed Oct 18, 2023
1 parent 6b9f9df commit e721b4f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions autotest.pm
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ sub loadtest ($script, %args) {
sys.path.append("$inc")
sys.path.append("$script_dir")
import $name
#print("Using python version: %s" % sys.version)
perl.diag("Using python version: %s" % sys.version)
END_OF_PYTHON_CODE
# Bind the python functions to the perl $name package
my %info = py_study_package("$name");
Expand Down
10 changes: 7 additions & 3 deletions t/08-autotest.t
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use Mojo::Base -strict, -signatures;
use FindBin '$Bin';
use lib "$Bin/../external/os-autoinst-common/lib";
use OpenQA::Test::TimeLimit '5';
use Test::Output qw(stderr_like combined_from);
use Test::Output qw(stderr_like combined_from output_like combined_like);
use Test::Exception;
use Test::Fatal;
use Test::Warnings qw(:report_warnings warning);
Expand Down Expand Up @@ -316,9 +316,13 @@ subtest 'load test successfully when CASEDIR is a relative path' => sub {
};

subtest python => sub {
stderr_like {
my $python_module_regex = qr{scheduling pythontest tests/pythontest};
my $python_version_regex = qr{Using python version};

combined_like {
lives_ok { autotest::loadtest('tests/pythontest.py') } 'can load test module'
} qr{scheduling pythontest tests/pythontest.py}, 'python pythontest module referenced';
} qr{(?|scheduling pythontest tests/pythontest|Using python version)}, 'python pythontest module referenced';

%autotest::tests = ();
loadtest 'pythontest.py';
loadtest 'morepython.py';
Expand Down

0 comments on commit e721b4f

Please sign in to comment.