CI: update all test and coverage reports
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
{"uid":"b1a8273437954620fa374b796ffaacdd","name":"behaviors","children":[]}
|
||||
@@ -0,0 +1 @@
|
||||
{"uid":"4b4757e66a1912dae1a509f688f20b0f","name":"categories","children":[]}
|
||||
@@ -0,0 +1 @@
|
||||
{"uid":"83edc06c07f9ae9e47eb6dd1b683e4e2","name":"packages","children":[]}
|
||||
@@ -0,0 +1 @@
|
||||
{"uid":"98d3104e051c652961429bf95fa0b5d6","name":"suites","children":[]}
|
||||
@@ -0,0 +1 @@
|
||||
{"uid":"ab17fc5a4eb3bca4b216b548c7f9fcbc","name":"timeline","children":[]}
|
||||
@@ -0,0 +1,11 @@
|
||||
launch_status failed=0 1752580230000000000
|
||||
launch_status broken=0 1752580230000000000
|
||||
launch_status passed=0 1752580230000000000
|
||||
launch_status skipped=0 1752580230000000000
|
||||
launch_status unknown=0 1752580230000000000
|
||||
launch_time duration=0 1752580230000000000
|
||||
launch_time min_duration=0 1752580230000000000
|
||||
launch_time max_duration=0 1752580230000000000
|
||||
launch_time sum_duration=0 1752580230000000000
|
||||
launch_retries retries=0 1752580230000000000
|
||||
launch_retries run=0 1752580230000000000
|
||||
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Allure Report summary mail</title>
|
||||
</head>
|
||||
<body>
|
||||
Mail body
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,11 @@
|
||||
launch_status_failed 0
|
||||
launch_status_broken 0
|
||||
launch_status_passed 0
|
||||
launch_status_skipped 0
|
||||
launch_status_unknown 0
|
||||
launch_time_duration 0
|
||||
launch_time_min_duration 0
|
||||
launch_time_max_duration 0
|
||||
launch_time_sum_duration 0
|
||||
launch_retries_retries 0
|
||||
launch_retries_run 0
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
@@ -0,0 +1 @@
|
||||
[{"data":{}}]
|
||||
@@ -0,0 +1 @@
|
||||
[{"data":{}}]
|
||||
@@ -0,0 +1 @@
|
||||
[{"data":{"failed":0,"broken":0,"skipped":0,"passed":0,"unknown":0,"total":0}}]
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
[{"data":{"run":0,"retry":0}}]
|
||||
@@ -0,0 +1,34 @@
|
||||
<!DOCTYPE html>
|
||||
<html dir="ltr" lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Allure Report</title>
|
||||
<link rel="icon" href="favicon.ico">
|
||||
<link rel="stylesheet" type="text/css" href="styles.css">
|
||||
<link rel="stylesheet" type="text/css" href="plugin/screen-diff/styles.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="alert"></div>
|
||||
<div id="content">
|
||||
<span class="spinner">
|
||||
<span class="spinner__circle"></span>
|
||||
</span>
|
||||
</div>
|
||||
<div id="popup"></div>
|
||||
<script src="app.js"></script>
|
||||
<script src="plugin/behaviors/index.js"></script>
|
||||
<script src="plugin/packages/index.js"></script>
|
||||
<script src="plugin/screen-diff/index.js"></script>
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-FVWC4GKEYS"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
gtag('config', 'G-FVWC4GKEYS', {
|
||||
'allureVersion': 'dev',
|
||||
'reportUuid': '704b7776-e11e-47ac-86b3-939b73ff5797',
|
||||
'single_file': false
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,206 @@
|
||||
'use strict';
|
||||
|
||||
allure.api.addTranslation('en', {
|
||||
tab: {
|
||||
behaviors: {
|
||||
name: 'Behaviors'
|
||||
}
|
||||
},
|
||||
widget: {
|
||||
behaviors: {
|
||||
name: 'Features by stories',
|
||||
showAll: 'show all'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
allure.api.addTranslation('ru', {
|
||||
tab: {
|
||||
behaviors: {
|
||||
name: 'Функциональность'
|
||||
}
|
||||
},
|
||||
widget: {
|
||||
behaviors: {
|
||||
name: 'Функциональность',
|
||||
showAll: 'показать все'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
allure.api.addTranslation('zh', {
|
||||
tab: {
|
||||
behaviors: {
|
||||
name: '功能'
|
||||
}
|
||||
},
|
||||
widget: {
|
||||
behaviors: {
|
||||
name: '特性场景',
|
||||
showAll: '显示所有'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
allure.api.addTranslation('de', {
|
||||
tab: {
|
||||
behaviors: {
|
||||
name: 'Verhalten'
|
||||
}
|
||||
},
|
||||
widget: {
|
||||
behaviors: {
|
||||
name: 'Features nach Stories',
|
||||
showAll: 'Zeige alle'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
allure.api.addTranslation('nl', {
|
||||
tab: {
|
||||
behaviors: {
|
||||
name: 'Functionaliteit'
|
||||
}
|
||||
},
|
||||
widget: {
|
||||
behaviors: {
|
||||
name: 'Features en story’s',
|
||||
showAll: 'Toon alle'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
allure.api.addTranslation('he', {
|
||||
tab: {
|
||||
behaviors: {
|
||||
name: 'התנהגויות'
|
||||
}
|
||||
},
|
||||
widget: {
|
||||
behaviors: {
|
||||
name: 'תכונות לפי סיפורי משתמש',
|
||||
showAll: 'הצג הכול'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
allure.api.addTranslation('br', {
|
||||
tab: {
|
||||
behaviors: {
|
||||
name: 'Comportamentos'
|
||||
}
|
||||
},
|
||||
widget: {
|
||||
behaviors: {
|
||||
name: 'Funcionalidades por história',
|
||||
showAll: 'Mostrar tudo'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
allure.api.addTranslation('ja', {
|
||||
tab: {
|
||||
behaviors: {
|
||||
name: '振る舞い'
|
||||
}
|
||||
},
|
||||
widget: {
|
||||
behaviors: {
|
||||
name: 'ストーリー別の機能',
|
||||
showAll: '全て表示'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
allure.api.addTranslation('es', {
|
||||
tab: {
|
||||
behaviors: {
|
||||
name: 'Funcionalidades'
|
||||
}
|
||||
},
|
||||
widget: {
|
||||
behaviors: {
|
||||
name: 'Funcionalidades por Historias de Usuario',
|
||||
showAll: 'mostrar todo'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
allure.api.addTranslation('kr', {
|
||||
tab: {
|
||||
behaviors: {
|
||||
name: '동작'
|
||||
}
|
||||
},
|
||||
widget: {
|
||||
behaviors: {
|
||||
name: '스토리별 기능',
|
||||
showAll: '전체 보기'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
allure.api.addTranslation('fr', {
|
||||
tab: {
|
||||
behaviors: {
|
||||
name: 'Comportements'
|
||||
}
|
||||
},
|
||||
widget: {
|
||||
behaviors: {
|
||||
name: 'Thèmes par histoires',
|
||||
showAll: 'Montrer tout'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
allure.api.addTranslation('pl', {
|
||||
tab: {
|
||||
behaviors: {
|
||||
name: 'Zachowania'
|
||||
}
|
||||
},
|
||||
widget: {
|
||||
behaviors: {
|
||||
name: 'Funkcje według historii',
|
||||
showAll: 'pokaż wszystko'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
allure.api.addTranslation('az', {
|
||||
tab: {
|
||||
behaviors: {
|
||||
name: 'Davranışlar'
|
||||
}
|
||||
},
|
||||
widget: {
|
||||
behaviors: {
|
||||
name: 'Hekayələr üzrə xüsusiyyətlər',
|
||||
showAll: 'hamısını göstər'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
allure.api.addTab('behaviors', {
|
||||
title: 'tab.behaviors.name', icon: 'fa fa-list',
|
||||
route: 'behaviors(/)(:testGroup)(/)(:testResult)(/)(:testResultTab)(/)',
|
||||
onEnter: (function (testGroup, testResult, testResultTab) {
|
||||
return new allure.components.TreeLayout({
|
||||
testGroup: testGroup,
|
||||
testResult: testResult,
|
||||
testResultTab: testResultTab,
|
||||
tabName: 'tab.behaviors.name',
|
||||
baseUrl: 'behaviors',
|
||||
url: 'data/behaviors.json',
|
||||
csvUrl: 'data/behaviors.csv'
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
allure.api.addWidget('widgets', 'behaviors', allure.components.WidgetStatusView.extend({
|
||||
rowTag: 'a',
|
||||
title: 'widget.behaviors.name',
|
||||
baseUrl: 'behaviors',
|
||||
showLinks: true
|
||||
}));
|
||||
@@ -0,0 +1,120 @@
|
||||
'use strict';
|
||||
|
||||
allure.api.addTranslation('en', {
|
||||
tab: {
|
||||
packages: {
|
||||
name: 'Packages'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
allure.api.addTranslation('ru', {
|
||||
tab: {
|
||||
packages: {
|
||||
name: 'Пакеты'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
allure.api.addTranslation('zh', {
|
||||
tab: {
|
||||
packages: {
|
||||
name: '包'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
allure.api.addTranslation('de', {
|
||||
tab: {
|
||||
packages: {
|
||||
name: 'Pakete'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
allure.api.addTranslation('nl', {
|
||||
tab: {
|
||||
packages: {
|
||||
name: 'Packages'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
allure.api.addTranslation('he', {
|
||||
tab: {
|
||||
packages: {
|
||||
name: 'חבילות'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
allure.api.addTranslation('br', {
|
||||
tab: {
|
||||
packages: {
|
||||
name: 'Pacotes'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
allure.api.addTranslation('ja', {
|
||||
tab: {
|
||||
packages: {
|
||||
name: 'パッケージ'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
allure.api.addTranslation('es', {
|
||||
tab: {
|
||||
packages: {
|
||||
name: 'Paquetes'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
allure.api.addTranslation('kr', {
|
||||
tab: {
|
||||
packages: {
|
||||
name: '패키지'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
allure.api.addTranslation('fr', {
|
||||
tab: {
|
||||
packages: {
|
||||
name: 'Paquets'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
allure.api.addTranslation('pl', {
|
||||
tab: {
|
||||
packages: {
|
||||
name: 'Pakiety'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
allure.api.addTranslation('az', {
|
||||
tab: {
|
||||
packages: {
|
||||
name: 'Paketlər'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
allure.api.addTab('packages', {
|
||||
title: 'tab.packages.name', icon: 'fa fa-align-left',
|
||||
route: 'packages(/)(:testGroup)(/)(:testResult)(/)(:testResultTab)(/)',
|
||||
onEnter: (function (testGroup, testResult, testResultTab) {
|
||||
return new allure.components.TreeLayout({
|
||||
testGroup: testGroup,
|
||||
testResult: testResult,
|
||||
testResultTab: testResultTab,
|
||||
tabName: 'tab.packages.name',
|
||||
baseUrl: 'packages',
|
||||
url: 'data/packages.json'
|
||||
});
|
||||
})
|
||||
});
|
||||
@@ -0,0 +1,200 @@
|
||||
(function () {
|
||||
var settings = allure.getPluginSettings('screen-diff', { diffType: 'diff' });
|
||||
|
||||
function renderImage(src) {
|
||||
return (
|
||||
'<div class="screen-diff__container">' +
|
||||
'<img class="screen-diff__image" src="' +
|
||||
src +
|
||||
'">' +
|
||||
'</div>'
|
||||
);
|
||||
}
|
||||
|
||||
function findImage(data, name) {
|
||||
if (data.testStage && data.testStage.attachments) {
|
||||
var matchedImage = data.testStage.attachments.filter(function (attachment) {
|
||||
return attachment.name === name;
|
||||
})[0];
|
||||
if (matchedImage) {
|
||||
return 'data/attachments/' + matchedImage.source;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function renderDiffContent(type, diffImage, actualImage, expectedImage) {
|
||||
if (type === 'diff') {
|
||||
if (diffImage) {
|
||||
return renderImage(diffImage);
|
||||
}
|
||||
}
|
||||
if (type === 'overlay' && expectedImage) {
|
||||
return (
|
||||
'<div class="screen-diff__overlay screen-diff__container">' +
|
||||
'<img class="screen-diff__image" src="' +
|
||||
expectedImage +
|
||||
'">' +
|
||||
'<div class="screen-diff__image-over">' +
|
||||
'<img class="screen-diff__image" src="' +
|
||||
actualImage +
|
||||
'">' +
|
||||
'</div>' +
|
||||
'</div>'
|
||||
);
|
||||
}
|
||||
if (actualImage) {
|
||||
return renderImage(actualImage);
|
||||
}
|
||||
return 'No diff data provided';
|
||||
}
|
||||
|
||||
var TestResultView = Backbone.Marionette.View.extend({
|
||||
regions: {
|
||||
subView: '.screen-diff-view',
|
||||
},
|
||||
template: function () {
|
||||
return '<div class="screen-diff-view"></div>';
|
||||
},
|
||||
onRender: function () {
|
||||
var data = this.model.toJSON();
|
||||
var testType = data.labels.filter(function (label) {
|
||||
return label.name === 'testType';
|
||||
})[0];
|
||||
var diffImage = findImage(data, 'diff');
|
||||
var actualImage = findImage(data, 'actual');
|
||||
var expectedImage = findImage(data, 'expected');
|
||||
if (!testType || testType.value !== 'screenshotDiff') {
|
||||
return;
|
||||
}
|
||||
this.showChildView(
|
||||
'subView',
|
||||
new ScreenDiffView({
|
||||
diffImage: diffImage,
|
||||
actualImage: actualImage,
|
||||
expectedImage: expectedImage,
|
||||
}),
|
||||
);
|
||||
},
|
||||
});
|
||||
var ErrorView = Backbone.Marionette.View.extend({
|
||||
templateContext: function () {
|
||||
return this.options;
|
||||
},
|
||||
template: function (data) {
|
||||
return '<pre class="screen-diff-error">' + data.error + '</pre>';
|
||||
},
|
||||
});
|
||||
var AttachmentView = Backbone.Marionette.View.extend({
|
||||
regions: {
|
||||
subView: '.screen-diff-view',
|
||||
},
|
||||
template: function () {
|
||||
return '<div class="screen-diff-view"></div>';
|
||||
},
|
||||
onRender: function () {
|
||||
jQuery
|
||||
.getJSON(this.options.sourceUrl)
|
||||
.then(this.renderScreenDiffView.bind(this), this.renderErrorView.bind(this));
|
||||
},
|
||||
renderErrorView: function (error) {
|
||||
console.log(error);
|
||||
this.showChildView(
|
||||
'subView',
|
||||
new ErrorView({
|
||||
error: error.statusText,
|
||||
}),
|
||||
);
|
||||
},
|
||||
renderScreenDiffView: function (data) {
|
||||
this.showChildView(
|
||||
'subView',
|
||||
new ScreenDiffView({
|
||||
diffImage: data.diff,
|
||||
actualImage: data.actual,
|
||||
expectedImage: data.expected,
|
||||
}),
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
var ScreenDiffView = Backbone.Marionette.View.extend({
|
||||
className: 'pane__section',
|
||||
events: function () {
|
||||
return {
|
||||
['click [name="screen-diff-type-' + this.cid + '"]']: 'onDiffTypeChange',
|
||||
'mousemove .screen-diff__overlay': 'onOverlayMove',
|
||||
};
|
||||
},
|
||||
initialize: function (options) {
|
||||
this.diffImage = options.diffImage;
|
||||
this.actualImage = options.actualImage;
|
||||
this.expectedImage = options.expectedImage;
|
||||
this.radioName = 'screen-diff-type-' + this.cid;
|
||||
},
|
||||
templateContext: function () {
|
||||
return {
|
||||
diffType: settings.get('diffType'),
|
||||
diffImage: this.diffImage,
|
||||
actualImage: this.actualImage,
|
||||
expectedImage: this.expectedImage,
|
||||
radioName: this.radioName,
|
||||
};
|
||||
},
|
||||
template: function (data) {
|
||||
if (!data.diffImage && !data.actualImage && !data.expectedImage) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return (
|
||||
'<h3 class="pane__section-title">Screen Diff</h3>' +
|
||||
'<div class="screen-diff__content">' +
|
||||
'<div class="screen-diff__switchers">' +
|
||||
'<label><input type="radio" name="' +
|
||||
data.radioName +
|
||||
'" value="diff"> Show diff</label>' +
|
||||
'<label><input type="radio" name="' +
|
||||
data.radioName +
|
||||
'" value="overlay"> Show overlay</label>' +
|
||||
'</div>' +
|
||||
renderDiffContent(
|
||||
data.diffType,
|
||||
data.diffImage,
|
||||
data.actualImage,
|
||||
data.expectedImage,
|
||||
) +
|
||||
'</div>'
|
||||
);
|
||||
},
|
||||
adjustImageSize: function (event) {
|
||||
var overImage = this.$(event.target);
|
||||
overImage.width(overImage.width());
|
||||
},
|
||||
onRender: function () {
|
||||
const diffType = settings.get('diffType');
|
||||
this.$('[name="' + this.radioName + '"][value="' + diffType + '"]').prop(
|
||||
'checked',
|
||||
true,
|
||||
);
|
||||
if (diffType === 'overlay') {
|
||||
this.$('.screen-diff__image-over img').on('load', this.adjustImageSize.bind(this));
|
||||
}
|
||||
},
|
||||
onOverlayMove: function (event) {
|
||||
var pageX = event.pageX;
|
||||
var containerScroll = this.$('.screen-diff__container').scrollLeft();
|
||||
var elementX = event.currentTarget.getBoundingClientRect().left;
|
||||
var delta = pageX - elementX + containerScroll;
|
||||
this.$('.screen-diff__image-over').width(delta);
|
||||
},
|
||||
onDiffTypeChange: function (event) {
|
||||
settings.save('diffType', event.target.value);
|
||||
this.render();
|
||||
},
|
||||
});
|
||||
allure.api.addTestResultBlock(TestResultView, { position: 'before' });
|
||||
allure.api.addAttachmentViewer('application/vnd.allure.image.diff', {
|
||||
View: AttachmentView,
|
||||
icon: 'fa fa-exchange',
|
||||
});
|
||||
})();
|
||||
@@ -0,0 +1,30 @@
|
||||
.screen-diff__switchers {
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
.screen-diff__switchers label + label {
|
||||
margin-left: 1em;
|
||||
}
|
||||
|
||||
.screen-diff__overlay {
|
||||
position: relative;
|
||||
cursor: col-resize;
|
||||
}
|
||||
|
||||
.screen-diff__container {
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.screen-diff__image-over {
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
background: #fff;
|
||||
position: absolute;
|
||||
overflow: hidden;
|
||||
box-shadow: 2px 0 1px -1px #aaa;
|
||||
}
|
||||
|
||||
.screen-diff-error {
|
||||
color: #fd5a3e;
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
{"total":0,"items":[]}
|
||||
@@ -0,0 +1 @@
|
||||
[{"data":{}}]
|
||||
@@ -0,0 +1 @@
|
||||
{"total":0,"items":[]}
|
||||
@@ -0,0 +1 @@
|
||||
[{"data":{}}]
|
||||
@@ -0,0 +1 @@
|
||||
[]
|
||||
@@ -0,0 +1 @@
|
||||
[]
|
||||
@@ -0,0 +1 @@
|
||||
[]
|
||||
@@ -0,0 +1 @@
|
||||
[{"data":{"failed":0,"broken":0,"skipped":0,"passed":0,"unknown":0,"total":0}}]
|
||||
@@ -0,0 +1 @@
|
||||
[]
|
||||
@@ -0,0 +1 @@
|
||||
[{"data":{"run":0,"retry":0}}]
|
||||
@@ -0,0 +1 @@
|
||||
[]
|
||||
@@ -0,0 +1 @@
|
||||
[]
|
||||
@@ -0,0 +1 @@
|
||||
{"total":0,"items":[]}
|
||||
@@ -0,0 +1 @@
|
||||
{"reportName":"Allure Report","testRuns":[],"statistic":{"failed":0,"broken":0,"skipped":0,"passed":0,"unknown":0,"total":0},"time":{}}
|
||||
@@ -6,49 +6,6 @@
|
||||
<summary>📋 Short test summary info</summary>
|
||||
|
||||
```
|
||||
=========================== short test summary info ============================
|
||||
FAILED tests/test_io_utils.py::test_cause_io_error - OSError: Forced IO Error for testing
|
||||
FAILED tests/test_io_utils.py::test_file_not_found - FileNotFoundError: [Errno 2] No such file or directory: 'nonexistent.file'
|
||||
FAILED tests/test_io_utils.py::test_permission_error - PermissionError: Permission denied
|
||||
FAILED tests/test_io_utils.py::test_mock_open_error - OSError: Mocked IOError
|
||||
FAILED tests/test_io_utils.py::test_file_handle_closed_error - ValueError: I/O operation on closed file
|
||||
FAILED tests/test_io_utils.py::test_os_error - OSError: Simulated OSError
|
||||
FAILED tests/test_io_utils.py::test_file_not_found_error - FileNotFoundError: [Errno 2] No such file or directory: 'no_such_file.txt'
|
||||
FAILED tests/test_math_utils.py::test_broken - NameError: name 'want_the_test_to_fail' is not defined
|
||||
FAILED tests/test_math_utils.py::test_call_missing_function - AttributeError: module 'functions.math_utils' has no attribute 'non_existent_function'
|
||||
FAILED tests/test_math_utils.py::test_addition_fail - assert 4 == 5
|
||||
+ where 4 = addition(2, 2)
|
||||
FAILED tests/test_math_utils.py::test_division_zero - ZeroDivisionError: division by zero
|
||||
FAILED tests/test_math_utils.py::test_runtime_error - RuntimeError: Forced runtime error
|
||||
FAILED tests/test_math_utils.py::test_memory_error - MemoryError: Simulated memory error
|
||||
FAILED tests/test_math_utils.py::test_timeout_error - TimeoutError: Simulated timeout error
|
||||
FAILED tests/test_math_utils.py::test_recursion_error - RecursionError: maximum recursion depth exceeded
|
||||
FAILED tests/test_math_utils.py::test_floating_point_error - FloatingPointError: Simulated floating point error
|
||||
FAILED tests/test_math_utils.py::test_floating_point_overflow - OverflowError: math range error
|
||||
FAILED tests/test_math_utils.py::test_value_error - ValueError: invalid literal for int() with base 10: 'invalid'
|
||||
FAILED tests/test_math_utils.py::test_type_error - TypeError: 'int' object is not iterable
|
||||
FAILED tests/test_math_utils.py::test_unhandled_exception - Exception: Generic unhandled exception
|
||||
FAILED tests/test_math_utils.py::test_custom_error - test_math_utils.CustomError: Custom error simulation
|
||||
FAILED tests/test_math_utils.py::test_stop_iteration_direct - RuntimeError: generator raised StopIteration
|
||||
FAILED tests/test_math_utils.py::test_generator_exit_direct - GeneratorExit
|
||||
FAILED tests/test_math_utils.py::test_recursion_limit - RecursionError: cannot set the recursion limit to 50 at the recursion depth 37: the limit is too low
|
||||
FAILED tests/test_math_utils.py::test_malformed_code - File "<string>", line 1
|
||||
def bad(:
|
||||
^
|
||||
SyntaxError: invalid syntax
|
||||
FAILED tests/test_math_utils.py::test_sys_exit - SystemExit: 1
|
||||
FAILED tests/test_math_utils.py::test_broken_function - TypeError: Broken function
|
||||
FAILED tests/test_math_utils.py::test_import_error_patch - ImportError: Simulated ImportError
|
||||
FAILED tests/test_math_utils.py::test_module_not_found_error - ModuleNotFoundError: No module named 'non_existent_module_xyz'
|
||||
FAILED tests/test_string_utils.py::test_uppercase_type_error - TypeError: Input cannot be None
|
||||
FAILED tests/test_string_utils.py::test_unicode_decode_error - UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
|
||||
FAILED tests/test_string_utils.py::test_unicode_decode_surrogateescape - UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte
|
||||
ERROR tests/test_broken_fct.py
|
||||
ERROR tests/test_collector_error.py
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! KeyboardInterrupt !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
/workspace/tligui_y/slic/tests/test_string_utils.py:43: KeyboardInterrupt
|
||||
(to show a full traceback on KeyboardInterrupt use --full-trace)
|
||||
======== 32 failed, 10 passed, 2 xfailed, 1 warning, 2 errors in 0.75s =========
|
||||
```
|
||||
</details>
|
||||
|
||||
@@ -56,577 +13,18 @@ ERROR tests/test_collector_error.py
|
||||
<summary>🪵 Full raw pytest log</summary>
|
||||
|
||||
```
|
||||
============================= test session starts ==============================
|
||||
platform linux -- Python 3.8.20, pytest-8.3.4, pluggy-1.5.0
|
||||
rootdir: /workspace/tligui_y/slic
|
||||
plugins: allure-pytest-2.13.5, cov-5.0.0, html-4.1.1, metadata-3.1.1, json-report-1.5.0, md-report-0.6.2
|
||||
collected 45 items / 2 errors
|
||||
ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...]
|
||||
pytest: error: unrecognized arguments: --result-log=ci-reports/markdown/pytest-result.log
|
||||
inifile: None
|
||||
rootdir: /workspace/tligui_y/slic
|
||||
|
||||
tests/test_io_utils.py ..FFFFFF.F
|
||||
tests/test_math_utils.py FF...FFxFFFFFFFFFFFFFFFFFF
|
||||
tests/test_string_utils.py .F..FF.x
|
||||
|
||||
==================================== ERRORS ====================================
|
||||
__________________ ERROR collecting tests/test_broken_fct.py ___________________
|
||||
.pixi/envs/default/lib/python3.8/site-packages/_pytest/python.py:493: in importtestmodule
|
||||
mod = import_path(
|
||||
.pixi/envs/default/lib/python3.8/site-packages/_pytest/pathlib.py:587: in import_path
|
||||
importlib.import_module(module_name)
|
||||
.pixi/envs/default/lib/python3.8/importlib/__init__.py:127: in import_module
|
||||
return _bootstrap._gcd_import(name[level:], package, level)
|
||||
<frozen importlib._bootstrap>:1014: in _gcd_import
|
||||
???
|
||||
<frozen importlib._bootstrap>:991: in _find_and_load
|
||||
???
|
||||
<frozen importlib._bootstrap>:975: in _find_and_load_unlocked
|
||||
???
|
||||
<frozen importlib._bootstrap>:671: in _load_unlocked
|
||||
???
|
||||
.pixi/envs/default/lib/python3.8/site-packages/_pytest/assertion/rewrite.py:175: in exec_module
|
||||
source_stat, co = _rewrite_test(fn, self.config)
|
||||
.pixi/envs/default/lib/python3.8/site-packages/_pytest/assertion/rewrite.py:355: in _rewrite_test
|
||||
tree = ast.parse(source, filename=strfn)
|
||||
.pixi/envs/default/lib/python3.8/ast.py:47: in parse
|
||||
return compile(source, filename, mode, flags,
|
||||
E File "/workspace/tligui_y/slic/tests/test_broken_fct.py", line 8
|
||||
E def test_valid_2():
|
||||
E ^
|
||||
E SyntaxError: invalid syntax
|
||||
________________ ERROR collecting tests/test_collector_error.py ________________
|
||||
ImportError while importing test module '/workspace/tligui_y/slic/tests/test_collector_error.py'.
|
||||
Hint: make sure your test modules/packages have valid Python names.
|
||||
Traceback:
|
||||
.pixi/envs/default/lib/python3.8/importlib/__init__.py:127: in import_module
|
||||
return _bootstrap._gcd_import(name[level:], package, level)
|
||||
tests/test_collector_error.py:1: in <module>
|
||||
from no_existing_module.math_utils import *
|
||||
E ModuleNotFoundError: No module named 'no_existing_module'
|
||||
=================================== FAILURES ===================================
|
||||
_____________________________ test_cause_io_error ______________________________
|
||||
|
||||
def test_cause_io_error():
|
||||
# Raises manual IOError to simulate IO failure
|
||||
> cause_io_error()
|
||||
|
||||
tests/test_io_utils.py:25:
|
||||
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
||||
|
||||
def cause_io_error():
|
||||
> raise IOError("Forced IO Error for testing")
|
||||
E OSError: Forced IO Error for testing
|
||||
|
||||
functions/io_utils.py:10: OSError
|
||||
_____________________________ test_file_not_found ______________________________
|
||||
|
||||
def test_file_not_found():
|
||||
# Reading non-existing file raises FileNotFoundError
|
||||
> read_file("nonexistent.file")
|
||||
|
||||
tests/test_io_utils.py:29:
|
||||
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
||||
|
||||
path = 'nonexistent.file'
|
||||
|
||||
def read_file(path):
|
||||
> with open(path, "r", encoding="utf-8") as f:
|
||||
E FileNotFoundError: [Errno 2] No such file or directory: 'nonexistent.file'
|
||||
|
||||
functions/io_utils.py:2: FileNotFoundError
|
||||
____________________________ test_permission_error _____________________________
|
||||
|
||||
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f0c49b4faf0>
|
||||
|
||||
def test_permission_error(monkeypatch):
|
||||
# Patch open to raise PermissionError simulating access denial
|
||||
def raise_perm_error(*args, **kwargs):
|
||||
raise PermissionError("Permission denied")
|
||||
monkeypatch.setattr("builtins.open", raise_perm_error)
|
||||
> read_file("anyfile.txt")
|
||||
|
||||
tests/test_io_utils.py:36:
|
||||
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
||||
functions/io_utils.py:2: in read_file
|
||||
with open(path, "r", encoding="utf-8") as f:
|
||||
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
||||
|
||||
args = ('anyfile.txt', 'r'), kwargs = {'encoding': 'utf-8'}
|
||||
|
||||
def raise_perm_error(*args, **kwargs):
|
||||
> raise PermissionError("Permission denied")
|
||||
E PermissionError: Permission denied
|
||||
|
||||
tests/test_io_utils.py:34: PermissionError
|
||||
_____________________________ test_mock_open_error _____________________________
|
||||
|
||||
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f0c494b4790>
|
||||
|
||||
def test_mock_open_error(monkeypatch):
|
||||
# Mock open() to raise IOError simulating read error
|
||||
mocked_open = mock.mock_open()
|
||||
mocked_open.side_effect = IOError("Mocked IOError")
|
||||
monkeypatch.setattr("builtins.open", mocked_open)
|
||||
> with open("file.txt", "r") as f:
|
||||
|
||||
tests/test_io_utils.py:43:
|
||||
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
||||
.pixi/envs/default/lib/python3.8/unittest/mock.py:1081: in __call__
|
||||
return self._mock_call(*args, **kwargs)
|
||||
.pixi/envs/default/lib/python3.8/unittest/mock.py:1085: in _mock_call
|
||||
return self._execute_mock_call(*args, **kwargs)
|
||||
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
||||
|
||||
self = <MagicMock name='open' spec='builtin_function_or_method' id='139690749080096'>
|
||||
args = ('file.txt', 'r'), kwargs = {}, effect = OSError('Mocked IOError')
|
||||
|
||||
def _execute_mock_call(self, /, *args, **kwargs):
|
||||
# separate from _increment_mock_call so that awaited functions are
|
||||
# executed separately from their call, also AsyncMock overrides this method
|
||||
|
||||
effect = self.side_effect
|
||||
if effect is not None:
|
||||
if _is_exception(effect):
|
||||
> raise effect
|
||||
E OSError: Mocked IOError
|
||||
|
||||
.pixi/envs/default/lib/python3.8/unittest/mock.py:1140: OSError
|
||||
________________________ test_file_handle_closed_error _________________________
|
||||
|
||||
def test_file_handle_closed_error():
|
||||
# Accessing closed file raises ValueError
|
||||
f = io.StringIO("content")
|
||||
f.close()
|
||||
> f.read()
|
||||
E ValueError: I/O operation on closed file
|
||||
|
||||
tests/test_io_utils.py:50: ValueError
|
||||
________________________________ test_os_error _________________________________
|
||||
|
||||
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f0c494b78e0>
|
||||
|
||||
def test_os_error(monkeypatch):
|
||||
# Patch os.remove to raise OSError simulating filesystem error
|
||||
def raise_os_error(path):
|
||||
raise OSError("Simulated OSError")
|
||||
monkeypatch.setattr("os.remove", raise_os_error)
|
||||
> os.remove("file.txt")
|
||||
|
||||
tests/test_io_utils.py:57:
|
||||
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
||||
|
||||
path = 'file.txt'
|
||||
|
||||
def raise_os_error(path):
|
||||
> raise OSError("Simulated OSError")
|
||||
E OSError: Simulated OSError
|
||||
|
||||
tests/test_io_utils.py:55: OSError
|
||||
__________________________ test_file_not_found_error ___________________________
|
||||
|
||||
def test_file_not_found_error():
|
||||
# Raises FileNotFoundError when opening a non-existent file
|
||||
> open("no_such_file.txt", "r")
|
||||
E FileNotFoundError: [Errno 2] No such file or directory: 'no_such_file.txt'
|
||||
|
||||
tests/test_io_utils.py:69: FileNotFoundError
|
||||
_________________________________ test_broken __________________________________
|
||||
|
||||
def test_broken():
|
||||
# simulating a broken or faulty test implementation that will cause the test to error
|
||||
> want_the_test_to_fail
|
||||
E NameError: name 'want_the_test_to_fail' is not defined
|
||||
|
||||
tests/test_math_utils.py:16: NameError
|
||||
__________________________ test_call_missing_function __________________________
|
||||
|
||||
def test_call_missing_function():
|
||||
# Accessing a missing function attribute raises AttributeError
|
||||
> getattr(math_utils, "non_existent_function")()
|
||||
E AttributeError: module 'functions.math_utils' has no attribute 'non_existent_function'
|
||||
|
||||
tests/test_math_utils.py:20: AttributeError
|
||||
______________________________ test_addition_fail ______________________________
|
||||
|
||||
def test_addition_fail():
|
||||
# Assertion failure: expected incorrect result
|
||||
> assert addition(2, 2) == 5
|
||||
E assert 4 == 5
|
||||
E + where 4 = addition(2, 2)
|
||||
|
||||
tests/test_math_utils.py:35: AssertionError
|
||||
______________________________ test_division_zero ______________________________
|
||||
|
||||
def test_division_zero():
|
||||
# Will raise ZeroDivisionError if not handled in division
|
||||
> division(1, 0)
|
||||
|
||||
tests/test_math_utils.py:39:
|
||||
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
||||
|
||||
a = 1, b = 0
|
||||
|
||||
def division(a, b):
|
||||
> return a / b
|
||||
E ZeroDivisionError: division by zero
|
||||
|
||||
functions/math_utils.py:5: ZeroDivisionError
|
||||
______________________________ test_runtime_error ______________________________
|
||||
|
||||
def test_runtime_error():
|
||||
# Test raises an uncaught RuntimeError
|
||||
> raise RuntimeError("Forced runtime error")
|
||||
E RuntimeError: Forced runtime error
|
||||
|
||||
tests/test_math_utils.py:48: RuntimeError
|
||||
______________________________ test_memory_error _______________________________
|
||||
|
||||
def test_memory_error():
|
||||
# Manually raise MemoryError to simulate out-of-memory condition
|
||||
> raise MemoryError("Simulated memory error")
|
||||
E MemoryError: Simulated memory error
|
||||
|
||||
tests/test_math_utils.py:52: MemoryError
|
||||
______________________________ test_timeout_error ______________________________
|
||||
|
||||
def test_timeout_error():
|
||||
# Manually raise TimeoutError simulating timeout conditions
|
||||
> raise TimeoutError("Simulated timeout error")
|
||||
E TimeoutError: Simulated timeout error
|
||||
|
||||
tests/test_math_utils.py:56: TimeoutError
|
||||
_____________________________ test_recursion_error _____________________________
|
||||
|
||||
def test_recursion_error():
|
||||
# Infinite recursion triggers RecursionError
|
||||
def recursive():
|
||||
return recursive()
|
||||
> recursive()
|
||||
|
||||
tests/test_math_utils.py:62:
|
||||
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
||||
tests/test_math_utils.py:61: in recursive
|
||||
return recursive()
|
||||
tests/test_math_utils.py:61: in recursive
|
||||
return recursive()
|
||||
E RecursionError: maximum recursion depth exceeded
|
||||
!!! Recursion detected (same locals & position)
|
||||
__________________________ test_floating_point_error ___________________________
|
||||
|
||||
def test_floating_point_error():
|
||||
# Manually raise FloatingPointError (rare in practice)
|
||||
> raise FloatingPointError("Simulated floating point error")
|
||||
E FloatingPointError: Simulated floating point error
|
||||
|
||||
tests/test_math_utils.py:66: FloatingPointError
|
||||
_________________________ test_floating_point_overflow _________________________
|
||||
|
||||
def test_floating_point_overflow():
|
||||
# Exponential overflow triggers OverflowError
|
||||
> math.exp(1000)
|
||||
E OverflowError: math range error
|
||||
|
||||
tests/test_math_utils.py:70: OverflowError
|
||||
_______________________________ test_value_error _______________________________
|
||||
|
||||
def test_value_error():
|
||||
# ValueError on invalid integer conversion
|
||||
> int("invalid")
|
||||
E ValueError: invalid literal for int() with base 10: 'invalid'
|
||||
|
||||
tests/test_math_utils.py:74: ValueError
|
||||
_______________________________ test_type_error ________________________________
|
||||
|
||||
def test_type_error():
|
||||
# TypeError when passing wrong argument type to sum
|
||||
> sum(5)
|
||||
E TypeError: 'int' object is not iterable
|
||||
|
||||
tests/test_math_utils.py:78: TypeError
|
||||
___________________________ test_unhandled_exception ___________________________
|
||||
|
||||
def test_unhandled_exception():
|
||||
# Raises generic unhandled Exception
|
||||
> raise Exception("Generic unhandled exception")
|
||||
E Exception: Generic unhandled exception
|
||||
|
||||
tests/test_math_utils.py:82: Exception
|
||||
______________________________ test_custom_error _______________________________
|
||||
|
||||
def test_custom_error():
|
||||
# Raises user-defined CustomError exception
|
||||
> raise CustomError("Custom error simulation")
|
||||
E test_math_utils.CustomError: Custom error simulation
|
||||
|
||||
tests/test_math_utils.py:86: CustomError
|
||||
__________________________ test_stop_iteration_direct __________________________
|
||||
|
||||
def test_stop_iteration_direct():
|
||||
# Directly raise StopIteration exception
|
||||
> raise StopIteration()
|
||||
E StopIteration
|
||||
|
||||
tests/test_math_utils.py:90: StopIteration
|
||||
|
||||
The above exception was the direct cause of the following exception:
|
||||
|
||||
cls = <class '_pytest.runner.CallInfo'>
|
||||
func = <function call_and_report.<locals>.<lambda> at 0x7f0c497a8c10>
|
||||
when = 'call'
|
||||
reraise = (<class '_pytest.outcomes.Exit'>, <class 'KeyboardInterrupt'>)
|
||||
|
||||
@classmethod
|
||||
def from_call(
|
||||
cls,
|
||||
func: Callable[[], TResult],
|
||||
when: Literal["collect", "setup", "call", "teardown"],
|
||||
reraise: type[BaseException] | tuple[type[BaseException], ...] | None = None,
|
||||
) -> CallInfo[TResult]:
|
||||
"""Call func, wrapping the result in a CallInfo.
|
||||
|
||||
:param func:
|
||||
The function to call. Called without arguments.
|
||||
:type func: Callable[[], _pytest.runner.TResult]
|
||||
:param when:
|
||||
The phase in which the function is called.
|
||||
:param reraise:
|
||||
Exception or exceptions that shall propagate if raised by the
|
||||
function, instead of being wrapped in the CallInfo.
|
||||
"""
|
||||
excinfo = None
|
||||
start = timing.time()
|
||||
precise_start = timing.perf_counter()
|
||||
try:
|
||||
> result: TResult | None = func()
|
||||
|
||||
.pixi/envs/default/lib/python3.8/site-packages/_pytest/runner.py:341:
|
||||
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
||||
.pixi/envs/default/lib/python3.8/site-packages/_pytest/runner.py:242: in <lambda>
|
||||
lambda: runtest_hook(item=item, **kwds), when=when, reraise=reraise
|
||||
.pixi/envs/default/lib/python3.8/site-packages/pluggy/_hooks.py:513: in __call__
|
||||
return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
|
||||
.pixi/envs/default/lib/python3.8/site-packages/pluggy/_manager.py:120: in _hookexec
|
||||
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
|
||||
.pixi/envs/default/lib/python3.8/site-packages/_pytest/threadexception.py:92: in pytest_runtest_call
|
||||
yield from thread_exception_runtest_hook()
|
||||
.pixi/envs/default/lib/python3.8/site-packages/_pytest/threadexception.py:68: in thread_exception_runtest_hook
|
||||
yield
|
||||
.pixi/envs/default/lib/python3.8/site-packages/_pytest/unraisableexception.py:95: in pytest_runtest_call
|
||||
yield from unraisable_exception_runtest_hook()
|
||||
.pixi/envs/default/lib/python3.8/site-packages/_pytest/unraisableexception.py:70: in unraisable_exception_runtest_hook
|
||||
yield
|
||||
.pixi/envs/default/lib/python3.8/site-packages/_pytest/logging.py:846: in pytest_runtest_call
|
||||
yield from self._runtest_for(item, "call")
|
||||
.pixi/envs/default/lib/python3.8/site-packages/_pytest/logging.py:829: in _runtest_for
|
||||
yield
|
||||
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
||||
|
||||
self = <CaptureManager _method='no' _global_capturing=<MultiCapture out=None err=None in_=None _state='suspended' _in_suspended=False> _capture_fixture=None>
|
||||
item = <Function test_stop_iteration_direct>
|
||||
|
||||
@hookimpl(wrapper=True)
|
||||
def pytest_runtest_call(self, item: Item) -> Generator[None]:
|
||||
with self.item_capture("call", item):
|
||||
> return (yield)
|
||||
E RuntimeError: generator raised StopIteration
|
||||
|
||||
.pixi/envs/default/lib/python3.8/site-packages/_pytest/capture.py:880: RuntimeError
|
||||
__________________________ test_generator_exit_direct __________________________
|
||||
|
||||
def test_generator_exit_direct():
|
||||
# Directly raise GeneratorExit exception
|
||||
> raise GeneratorExit()
|
||||
E GeneratorExit
|
||||
|
||||
tests/test_math_utils.py:94: GeneratorExit
|
||||
_____________________________ test_recursion_limit _____________________________
|
||||
|
||||
def test_recursion_limit():
|
||||
# Lower recursion limit to force RecursionError on deep recursion
|
||||
original_limit = sys.getrecursionlimit()
|
||||
> sys.setrecursionlimit(50)
|
||||
E RecursionError: cannot set the recursion limit to 50 at the recursion depth 37: the limit is too low
|
||||
|
||||
tests/test_math_utils.py:99: RecursionError
|
||||
_____________________________ test_malformed_code ______________________________
|
||||
|
||||
def test_malformed_code():
|
||||
# SyntaxError when executing malformed Python code
|
||||
> exec("def bad(:\n pass")
|
||||
E File "<string>", line 1
|
||||
E def bad(:
|
||||
E ^
|
||||
E SyntaxError: invalid syntax
|
||||
|
||||
tests/test_math_utils.py:109: SyntaxError
|
||||
________________________________ test_sys_exit _________________________________
|
||||
|
||||
def test_sys_exit():
|
||||
# Simulate SystemExit via sys.exit
|
||||
> sys.exit(1)
|
||||
E SystemExit: 1
|
||||
|
||||
tests/test_math_utils.py:113: SystemExit
|
||||
_____________________________ test_broken_function _____________________________
|
||||
|
||||
def test_broken_function():
|
||||
# Simulate broken function raising TypeError
|
||||
def broken_func(*args, **kwargs):
|
||||
raise TypeError("Broken function")
|
||||
> broken_func()
|
||||
|
||||
tests/test_math_utils.py:119:
|
||||
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
||||
|
||||
args = (), kwargs = {}
|
||||
|
||||
def broken_func(*args, **kwargs):
|
||||
> raise TypeError("Broken function")
|
||||
E TypeError: Broken function
|
||||
|
||||
tests/test_math_utils.py:118: TypeError
|
||||
___________________________ test_import_error_patch ____________________________
|
||||
|
||||
def test_import_error_patch():
|
||||
# Patch import to simulate ImportError on specific module
|
||||
original_import = __import__
|
||||
def fake_import(name, *args, **kwargs):
|
||||
if name == "fake_module":
|
||||
raise ImportError("Simulated ImportError")
|
||||
return original_import(name, *args, **kwargs)
|
||||
import builtins
|
||||
builtins.__import__, old_import = fake_import, builtins.__import__
|
||||
try:
|
||||
> __import__("fake_module")
|
||||
|
||||
tests/test_math_utils.py:131:
|
||||
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
||||
|
||||
name = 'fake_module', args = (), kwargs = {}
|
||||
|
||||
def fake_import(name, *args, **kwargs):
|
||||
if name == "fake_module":
|
||||
> raise ImportError("Simulated ImportError")
|
||||
E ImportError: Simulated ImportError
|
||||
|
||||
tests/test_math_utils.py:126: ImportError
|
||||
_________________________ test_module_not_found_error __________________________
|
||||
|
||||
def test_module_not_found_error():
|
||||
# Raises ModuleNotFoundError (subclass of ImportError) for missing module
|
||||
> importlib.import_module("non_existent_module_xyz")
|
||||
|
||||
tests/test_math_utils.py:137:
|
||||
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
||||
.pixi/envs/default/lib/python3.8/importlib/__init__.py:127: in import_module
|
||||
return _bootstrap._gcd_import(name[level:], package, level)
|
||||
<frozen importlib._bootstrap>:1014: in _gcd_import
|
||||
???
|
||||
<frozen importlib._bootstrap>:991: in _find_and_load
|
||||
???
|
||||
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
||||
|
||||
name = 'non_existent_module_xyz'
|
||||
import_ = <function _gcd_import at 0x7f0c4e01f4c0>
|
||||
|
||||
> ???
|
||||
E ModuleNotFoundError: No module named 'non_existent_module_xyz'
|
||||
|
||||
<frozen importlib._bootstrap>:973: ModuleNotFoundError
|
||||
__________________________ test_uppercase_type_error ___________________________
|
||||
|
||||
def test_uppercase_type_error():
|
||||
# TypeError when input is None (invalid input)
|
||||
> uppercase(None)
|
||||
|
||||
tests/test_string_utils.py:14:
|
||||
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
||||
|
||||
s = None
|
||||
|
||||
def uppercase(s):
|
||||
if s is None:
|
||||
> raise TypeError("Input cannot be None")
|
||||
E TypeError: Input cannot be None
|
||||
|
||||
functions/string_utils.py:3: TypeError
|
||||
__________________________ test_unicode_decode_error ___________________________
|
||||
|
||||
def test_unicode_decode_error():
|
||||
# UnicodeDecodeError when decoding invalid byte sequence
|
||||
> b'\xff'.decode('utf-8')
|
||||
E UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
|
||||
|
||||
tests/test_string_utils.py:26: UnicodeDecodeError
|
||||
_____________________ test_unicode_decode_surrogateescape ______________________
|
||||
|
||||
def test_unicode_decode_surrogateescape():
|
||||
# UnicodeDecodeError with strict error handler on invalid byte
|
||||
> b"\x80".decode("utf-8", errors="strict")
|
||||
E UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte
|
||||
|
||||
tests/test_string_utils.py:30: UnicodeDecodeError
|
||||
=============================== warnings summary ===============================
|
||||
tests/test_string_utils.py::test_warning_emit
|
||||
/workspace/tligui_y/slic/tests/test_string_utils.py:22: UserWarning: Test warning
|
||||
warnings.warn("Test warning", UserWarning)
|
||||
|
||||
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
|
||||
--------------------------------- JSON report ----------------------------------
|
||||
report saved to: ci-reports/markdown/pytest-report.json
|
||||
|
||||
---------- coverage: platform linux, python 3.8.20-final-0 -----------
|
||||
Coverage HTML written to dir ci-reports/coverage/
|
||||
Coverage XML written to file ci-reports/coverage/coverage.xml
|
||||
|
||||
=========================== short test summary info ============================
|
||||
FAILED tests/test_io_utils.py::test_cause_io_error - OSError: Forced IO Error for testing
|
||||
FAILED tests/test_io_utils.py::test_file_not_found - FileNotFoundError: [Errno 2] No such file or directory: 'nonexistent.file'
|
||||
FAILED tests/test_io_utils.py::test_permission_error - PermissionError: Permission denied
|
||||
FAILED tests/test_io_utils.py::test_mock_open_error - OSError: Mocked IOError
|
||||
FAILED tests/test_io_utils.py::test_file_handle_closed_error - ValueError: I/O operation on closed file
|
||||
FAILED tests/test_io_utils.py::test_os_error - OSError: Simulated OSError
|
||||
FAILED tests/test_io_utils.py::test_file_not_found_error - FileNotFoundError: [Errno 2] No such file or directory: 'no_such_file.txt'
|
||||
FAILED tests/test_math_utils.py::test_broken - NameError: name 'want_the_test_to_fail' is not defined
|
||||
FAILED tests/test_math_utils.py::test_call_missing_function - AttributeError: module 'functions.math_utils' has no attribute 'non_existent_function'
|
||||
FAILED tests/test_math_utils.py::test_addition_fail - assert 4 == 5
|
||||
+ where 4 = addition(2, 2)
|
||||
FAILED tests/test_math_utils.py::test_division_zero - ZeroDivisionError: division by zero
|
||||
FAILED tests/test_math_utils.py::test_runtime_error - RuntimeError: Forced runtime error
|
||||
FAILED tests/test_math_utils.py::test_memory_error - MemoryError: Simulated memory error
|
||||
FAILED tests/test_math_utils.py::test_timeout_error - TimeoutError: Simulated timeout error
|
||||
FAILED tests/test_math_utils.py::test_recursion_error - RecursionError: maximum recursion depth exceeded
|
||||
FAILED tests/test_math_utils.py::test_floating_point_error - FloatingPointError: Simulated floating point error
|
||||
FAILED tests/test_math_utils.py::test_floating_point_overflow - OverflowError: math range error
|
||||
FAILED tests/test_math_utils.py::test_value_error - ValueError: invalid literal for int() with base 10: 'invalid'
|
||||
FAILED tests/test_math_utils.py::test_type_error - TypeError: 'int' object is not iterable
|
||||
FAILED tests/test_math_utils.py::test_unhandled_exception - Exception: Generic unhandled exception
|
||||
FAILED tests/test_math_utils.py::test_custom_error - test_math_utils.CustomError: Custom error simulation
|
||||
FAILED tests/test_math_utils.py::test_stop_iteration_direct - RuntimeError: generator raised StopIteration
|
||||
FAILED tests/test_math_utils.py::test_generator_exit_direct - GeneratorExit
|
||||
FAILED tests/test_math_utils.py::test_recursion_limit - RecursionError: cannot set the recursion limit to 50 at the recursion depth 37: the limit is too low
|
||||
FAILED tests/test_math_utils.py::test_malformed_code - File "<string>", line 1
|
||||
def bad(:
|
||||
^
|
||||
SyntaxError: invalid syntax
|
||||
FAILED tests/test_math_utils.py::test_sys_exit - SystemExit: 1
|
||||
FAILED tests/test_math_utils.py::test_broken_function - TypeError: Broken function
|
||||
FAILED tests/test_math_utils.py::test_import_error_patch - ImportError: Simulated ImportError
|
||||
FAILED tests/test_math_utils.py::test_module_not_found_error - ModuleNotFoundError: No module named 'non_existent_module_xyz'
|
||||
FAILED tests/test_string_utils.py::test_uppercase_type_error - TypeError: Input cannot be None
|
||||
FAILED tests/test_string_utils.py::test_unicode_decode_error - UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
|
||||
FAILED tests/test_string_utils.py::test_unicode_decode_surrogateescape - UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte
|
||||
ERROR tests/test_broken_fct.py
|
||||
ERROR tests/test_collector_error.py
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! KeyboardInterrupt !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
/workspace/tligui_y/slic/tests/test_string_utils.py:43: KeyboardInterrupt
|
||||
(to show a full traceback on KeyboardInterrupt use --full-trace)
|
||||
======== 32 failed, 10 passed, 2 xfailed, 1 warning, 2 errors in 0.75s =========
|
||||
```
|
||||
</details>
|
||||
|
||||
---
|
||||
|
||||
# 🧪 Test Report
|
||||
*Generated on 2025-07-15 11:42:21*
|
||||
*Generated on 2025-07-15 11:50:31*
|
||||
|
||||
## 📋 Summary
|
||||
- **Passed**: `11`
|
||||
|
||||
@@ -1,7 +1 @@
|
||||
| Name | Stmts | Miss | Cover |
|
||||
|--------------------------- | -------: | -------: | -------: |
|
||||
| functions/\_\_init\_\_.py | 0 | 0 | 100% |
|
||||
| functions/io\_utils.py | 8 | 0 | 100% |
|
||||
| functions/math\_utils.py | 6 | 0 | 100% |
|
||||
| functions/string\_utils.py | 6 | 0 | 100% |
|
||||
| **TOTAL** | **20** | **0** | **100%** |
|
||||
No data to report.
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...]
|
||||
pytest: error: unrecognized arguments: --result-log=ci-reports/markdown/pytest-result.log
|
||||
inifile: None
|
||||
rootdir: /workspace/tligui_y/slic
|
||||
|
||||
Reference in New Issue
Block a user