-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPythonTests.m
More file actions
44 lines (35 loc) · 1.06 KB
/
Copy pathPythonTests.m
File metadata and controls
44 lines (35 loc) · 1.06 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
40
41
42
43
44
//
// PythonTests.m
// PythonTests
//
// Created by zengxs on 2019/6/30.
// Copyright © 2019 zengxs. All rights reserved.
//
#import <XCTest/XCTest.h>
#import <Python/Python.h>
#import <Python/framework-init.h>
@interface PythonTests : XCTestCase
@end
@implementation PythonTests
- (void)setUp {
// Put setup code here. This method is called before the invocation of each test method in the class.
PyFramework_Initialize();
Py_Initialize();
}
- (void)tearDown {
// Put teardown code here. This method is called after the invocation of each test method in the class.
Py_Finalize();
}
- (void)testHello {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
PyRun_SimpleString("print('hello, world')");
PyRun_SimpleString("import sys; print(sys.version)");
}
- (void)testPerformanceExample {
// This is an example of a performance test case.
[self measureBlock:^{
// Put the code you want to measure the time of here.
}];
}
@end