-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_load_py27.py
More file actions
39 lines (32 loc) · 1.01 KB
/
test_load_py27.py
File metadata and controls
39 lines (32 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Test script for load package in Python 2.7
"""
from __future__ import print_function, unicode_literals
import sys
import os
print("Python version:", sys.version)
print("Python executable:", sys.executable)
# Try to import the load package
try:
print("\nAttempting to import load...")
import load
print("Successfully imported load package!")
print("Load version:", load.__version__)
# Test basic functionality
print("\nTesting basic functionality...")
math = load('math')
print("Imported math module:", math)
print("math.sqrt(16) =", math.sqrt(16))
# Test auto-print
print("\nTesting auto-print...")
load.enable_auto_print()
result = load('math.sqrt(25)')
print("Result of load('math.sqrt(25)'):", result)
print("\nPython 2.7 compatibility tests completed successfully!")
except Exception as e:
print("\nError during testing:", str(e))
import traceback
traceback.print_exc()
sys.exit(1)