Skip to content

Instantly share code, notes, and snippets.

View elyezer's full-sized avatar

Elyézer Rezende elyezer

View GitHub Profile
import os
import re
def edit_case_importance():
for dirpath, _, filenames in os.walk('tests/foreman'):
for filename in filenames:
path = os.path.join(dirpath, filename)
if path.endswith('.py') and '__init__.py' not in path:
print(path)
@elyezer
elyezer / py.test.txt
Created December 12, 2016 14:05
Python subTest usage and how py.test is not able to report subTest failures.
$ py.test test.py
=============================================== test session starts ===============================================
platform linux -- Python 3.5.2, pytest-3.0.5, py-1.4.31, pluggy-0.4.0
rootdir: /home/elyezer/code, inifile:
collected 1 items
test.py F
==================================================== FAILURES =====================================================
_______________________________________ TestIsEven.test_should_all_be_even ________________________________________
<table border="0" cellspacing="5" cellpadding="5" style="font-family: Helvetica Neue,Helvetica,Arial,sans-serif; font-size: 14px; line-height:1.5;">
<tr>
<td valign="top" style="border-right: 1px solid #ddd;">
<img src="http://oliveiralopes.adv.br/images/logo.png" alt="" width="120px"/>
</td>
<td valign="top">
<p>
<strong>Aline dos Santos Oliveira</strong><br />
<span style="font-size: 12px;">OAB/MG 136.095</span>
</p>
@elyezer
elyezer / installing_docker_fedora.rst
Last active April 26, 2017 13:55
Steps to get Docker installed on a Fedora system

Install docker:

sudo dnf install docker

Add the docker group:

sudo groupadd docker

Add your user to the docker group:

#!/usr/bin/env sh
set -euo pipefail
dnf update -y
dnf install -y git vim ansible python-dnf libselinux-python
git clone https://github.com/pulp/pulp_packaging && cd pulp_packaging
echo localhost > hosts
ansible-playbook -i hosts --connection local -e pulp_version=2.13 \
ci/ansible/pulp_server.yaml
@elyezer
elyezer / sample_file.py
Created January 5, 2016 15:34
Using Python memory_profiler
$ pip install memory_profiler psutil
$ python -m memory_profiler sample_file.py
import pytest
import unittest
from nose.plugins.attrib import attr
class MyTestCase(unittest.TestCase):
@pytest.mark.crud
def test_pytest_crud(self):
pass
@elyezer
elyezer / virtualbox_kmod_sign.md
Last active September 4, 2015 22:51
VirtualBox in Secure Boot Linux

Create the certificate. Replace Org Name with something more appropriate.

mkdir ~/.certs
openssl req -new -x509 -newkey rsa:2048 -keyout ~/.certs/cert.key -outform DER -out ~/.certs/cert.der -nodes -days 36500 -subj "/CN=Org Name/"

After that import the certificate

sudo mokutil --import ~/.certs/cert.der
import re
import subprocess
from robottelo.common.helpers import bz_bug_is_open
OUTPUT_REGEX = re.compile(r'.*:\s+@.*, (\d+)\)')
skip_count = 0

Keybase proof

I hereby claim:

  • I am elyezer on github.
  • I am elyezer (https://keybase.io/elyezer) on keybase.
  • I have a public key whose fingerprint is BDBA 6625 8F1F F560 0CB5 3552 09C2 A753 0DC5 EE4E

To claim this, I am signing this object: