Skip to content

Instantly share code, notes, and snippets.

View mrcfps's full-sized avatar

Marc Chan mrcfps

  • Shanghai, China
View GitHub Profile
@mrcfps
mrcfps / bank_account_test.py
Created February 10, 2018 07:32
Modified bank-account test
import sys
import threading
import time
import unittest
from bank_account import BankAccount
class BankAccountTests(unittest.TestCase):
@mrcfps
mrcfps / bank_test.py
Created February 15, 2018 07:30
Exploration of how to test concurrency in Python
from __future__ import print_function
import platform
import sys
import threading
import time
class UnsyncedBankAccount(object):
"""Bank account with no synchronization lock, prone to race condition."""